math.trunc()
Drops the fractional part toward zero.
Signature
math.trunc(x)
Parameters
One number.
Returns
Integral-valued f64 for finite input.
Behavior
Uses the C math operation.
Errors
Requires a number.
Example
use math
assert(math.trunc(-1.8) == -1.0)