Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Functions

Functions

Export assignment maxabs

  • maxabs(x?: undefined | number, y?: undefined | number, ...args: Array<number>): number
  • Returns the maximum absolute value.

    Notes

    • When an empty set is considered a subset of the extended reals (all real numbers, including positive and negative infinity), negative infinity is the least upper bound. Similar to zero being the identity element for the sum of an empty set and to one being the identity element for the product of an empty set, negative infinity is the identity element for the maximum, and thus, if not provided any arguments, the function returns +infinity (i.e., the absolute value of -infinity).

    Parameters

    • Optional x: undefined | number

      first number

    • Optional y: undefined | number

      second number

    • Rest ...args: Array<number>

      numbers

    Returns number

    maximum absolute value

    Example

    var v = maxabs( 3.14, -4.2 );
    // returns 4.2

    Example

    var v = maxabs( 5.9, 3.14, 4.2 );
    // returns 5.9

    Example

    var v = maxabs( 3.14, NaN );
    // returns NaN

    Example

    var v = maxabs( +0.0, -0.0 );
    // returns +0.0