Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Index

Functions

Functions

max

  • max(x?: undefined | number, y?: undefined | number, ...args: Array<number>): number
  • Returns the maximum 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 negative infinity.

    Parameters

    • Optional x: undefined | number

      first number

    • Optional y: undefined | number

      second number

    • Rest ...args: Array<number>

      numbers

    Returns number

    maximum value

    Example

    var v = max( 3.14, 4.2 );
    // returns 4.2

    Example

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

    Example

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

    Example

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