Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Functions

Functions

isOdd

  • isOdd(x: number): boolean
  • Tests if a finite numeric value is an odd 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 odd number

    Example

    var bool = isOdd( 5.0 );
    // returns true

    Example

    var bool = isOdd( -2.0 );
    // returns false

    Example

    var bool = isOdd( 0.0 );
    // returns false

    Example

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