Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "math/base/assert/is-even/docs/types/index.d"

Index

Functions

Functions

isEven

  • isEven(x: number): boolean
  • Tests if a finite numeric value is an even number.

    Notes

    • The function assumes a finite number. If provided positive or negative infinity, the function will return true, when, in fact, the result is undefined.

    Parameters

    • x: number

      value to test

    Returns boolean

    boolean indicating whether the value is an even number

    Example

    var bool = isEven( 5.0 );
    // returns false

    Example

    var bool = isEven( -2.0 );
    // returns true

    Example

    var bool = isEven( 0.0 );
    // returns true

    Example

    var bool = isEven( NaN );
    // returns false