Module std.math

Additions to the math module.

Functions

floor (n, p) Extend math.floor to take the number of decimal places.
round (n, p) Round a number to a given number of decimal places


Functions

floor (n, p)
Extend math.floor to take the number of decimal places.

Parameters:

  • n number
  • p number of decimal places to truncate to (default: 0)

Returns:

    n truncated to p decimal places
round (n, p)
Round a number to a given number of decimal places

Parameters:

  • n number
  • p number of decimal places to round to (default: 0)

Returns:

    n rounded to p decimal places
generated by LDoc 1.4.0