trunc

fixed trunc(fixed x)

Description

Rounds x by truncating the fractional part and returns the result as a fixed-point number.

See the article on Rounding for all rounding modes.

Examples

trunc(2.3) -> 2.0
trunc(3.8) -> 3.0
trunc(5.5) -> 5.0
trunc(-2.3) -> -2.0
trunc(-3.8) -> -3.0
trunc(-5.5) -> -5.0