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 top
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 top
decimal places