Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "math/base/special/copysign/docs/types/index.d"

Index

Functions

Functions

Export assignment copysign

  • copysign(x: number, y: number): number
  • Returns a double-precision floating-point number with the magnitude of x and the sign of y.

    Parameters

    • x: number

      number from which to derive a magnitude

    • y: number

      number from which to derive a sign

    Returns number

    a double-precision floating-point number

    Example

    var z = copysign( -3.14, 10.0 );
    // returns 3.14

    Example

    var z = copysign( 3.14, -1.0 );
    // returns -3.14

    Example

    var z = copysign( 1.0, -0.0 );
    // returns -1.0

    Example

    var z = copysign( -3.14, -0.0 );
    // returns -3.14

    Example

    var z = copysign( -0.0, 1.0 );
    // returns 0.0