Module: math

Provides an API for enabling extra math functions.

Author:
  • Henry Brown
Source:

Methods


<static> ceil10(value, exp)

A ceiling function allowing for more discrete control over the rounding location.

Parameters:
Name Type Description
value Number

The value on which you want to perform the ceiling.

exp Number

The exponent of 10 marking the location from which to perform the ceiling. ceil10(456, 2) will round up to 500.

Source:
Returns:

The ceiled value (500 in the case above)

Type
Number

<static> disableCeil10()

Detaches the ceil10 function from the Math global.

Source:

<static> disableFloor10()

Detaches the floor10 function from the Math global.

Source:

<static> disableRound10()

Detaches the round10 function from the Math global.

Source:

<static> enableAll()

Enables all of the math functions including

Source:
Throws:

If Math has already implemented any of the above functions

Type
Error

<static> enableCeil10()

Attaches the ceil10 function to the Math global.

Source:
Throws:

If Math has already implemented ceil10

Type
Error

<static> enableFloor10()

Attaches the floor10 function to the Math global.

Source:
Throws:

If Math has already implemented floor10.

Type
Error

<static> enableRound10()

Attaches the round10 function to the Math global.

Source:
Throws:

If Math has already implemented round10

Type
Error

<static> floor10(value, exp)

A floor function allowing for more discrete control over the rounding location.

Parameters:
Name Type Description
value Number

The value on which you want to perform the floor.

exp Number

The exponent of 10 marking the location from which to perform the floor. floor10(987, 2) will round down to 900.

Source:
Returns:

The floored value (900 in the case above)

Type
Number

<static> round10(value, exp)

A rounding function allowing for more discrete control over the rounding location.

Parameters:
Name Type Description
value Number

The value on which you want to perform the round.

exp Number

The exponent of 10 marking the location from which to perform the round. round10(1251, 2) will round up to 1300.

Source:
Returns:

The rounded value (1300 in the case above)

Type
Number

<inner> decimalAdjust(type, value, exp)

Decimal adjustment of a number.

Parameters:
Name Type Description
type String

The type of adjustment.

value Number

The number.

exp Integer

The exponent (the 10 logarithm of the adjustment base).

Source:
Returns:

The adjusted value.

Type
Number