Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Functions

Functions

isSafeInteger

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

    Notes

    • An integer valued number is "safe" when the number can be exactly represented as a double-precision floating-point number.

    Parameters

    • x: number

      value to test

    Returns boolean

    boolean indicating whether the value is a safe integer

    Example

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

    Example

    var bool = isSafeInteger( 2.0e200 );
    // returns false

    Example

    var bool = isSafeInteger( 3.14 );
    // returns false