trunc
Rounds to the nearest integer in the direction of 0.
Syntax
-
trunc(x)
-
x
is a real number
-
Description
If x
is a real number, then trunc(x)
is the integer obtained by truncating x
, that is, by rounding x
towards 0
.
Examples
trunc(π)
3
trunc(e)
2
trunc(−π)
−3
trunc(−e)
−2