Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "number/float64/base/to-int32/docs/types/index.d"

Index

Functions

Functions

Export assignment float64ToInt32

  • float64ToInt32(x: number): number
  • Converts a double-precision floating-point number to a signed 32-bit integer.

    Parameters

    • x: number

      double-precision floating-point number

    Returns number

    signed 32-bit integer

    Example

    var y = float64ToInt32( 4294967295.0 );
    // returns -1

    Example

    var y = float64ToInt32( 3.14 );
    // returns 3

    Example

    var y = float64ToInt32( -3.14 );
    // returns -3

    Example

    var y = float64ToInt32( NaN );
    // returns 0

    Example

    var y = float64ToInt32( Infinity );
    // returns 0

    Example

    var y = float64ToInt32( -Infinity );
    // returns 0