Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Functions

isNonNegativeInteger

  • isNonNegativeInteger(x: number): boolean
  • Tests if a finite double-precision floating-point number is a nonnegative integer.

    Notes

    • The function assumes a finite number. If provided positive infinity, the function will return true, when, in fact, the result is undefined.
    • The function does not distinguish between positive and negative zero.

    Parameters

    • x: number

      value to test

    Returns boolean

    boolean indicating whether the value is a nonnegative integer

    Example

    var bool = isNonNegativeInteger( 1.0 );
    // returns true

    Example

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

    Example

    var bool = isNonNegativeInteger( -10.0 );
    // returns false