Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Functions

isNonPositiveInteger

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

    Notes

    • The function assumes a finite number. If provided negative 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 nonpositive integer

    Example

    var bool = isNonPositiveInteger( -1.0 );
    // returns true

    Example

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

    Example

    var bool = isNonPositiveInteger( 10.0 );
    // returns false