Math Functions

math.ceil

Double math.ceil(Double value)

Returns the ceiling of the input value, i.e., the value of the smallest integer greater than or equal to the value.

Parameters:

  • value - the input value (non-nullable).

Returns:

the ceiling of the input value.

math.floor

Double math.floor(Double value)

Returns the floor of the input value, i.e., the value of the largest integer greater than or equal to the value.

Parameters:

  • value - the input value (non-nullable).

Returns:

the floor of the input value.

math.isInfinity

<Numeric T> Bool math.isInfinity(T value)

Checks whether the input value is infinity.

Parameters:

  • value - the input value (non-nullable).

Returns:

true if the input value is infinity, false otherwise.

math.isNaN

<Numeric T> Bool math.isNaN(T value)

Checks whether the input value is NaN (not a number).

Parameters:

  • value - the input value (non-nullable).

Returns:

true if the input value is NaN (not a number), false otherwise.

math.isNegativeInfinity

<Numeric T> Bool math.isNegativeInfinity(T value)

Checks whether the input value is negative infinity.

Parameters:

  • value - the input value (non-nullable).

Returns:

true if the input value is negative infinity, false otherwise.

math.isPositiveInfinity

<Numeric T> Bool math.isPositiveInfinity(T value)

Checks whether the input value is positive infinity.

Parameters:

  • value - the input value (non-nullable).

Returns:

true if the input value is positive infinity, false otherwise.

math.log

Double math.log(Double value)

Returns the natural logarithm of the input value.

Parameters:

  • value - the input value (non-nullable).

Returns:

the natural logarithm of the input value.

math.max

<Primitive T> T math.max(T a, T b)

Finds the maximum of the two values.

Parameters:

  • a - the first value (non-nullable).
  • b - the second value (non-nullable).

Returns:

the maximum of the values.

math.min

<Primitive T> T math.min(T a, T b)

Finds the minimum of the two values.

Parameters:

  • a - the first value (non-nullable).
  • b - the second value (non-nullable).

Returns:

the minimum of the values.

math.pow

Double math.pow(Double base, Double exponent)

Returns the base value raised to the exponent.

Parameters:

  • base - the base (non-nullable).
  • exponent - the exponent (non-nullable).

Returns:

the base value raised to the exponent.