commands → trunc

trunc(x)

The trunc function computes the integer part of the numeric value x by truncating values after the decimal point.

Examples

trunc(2.5);
	2.
trunc(-2.5);
	-2.
trunc(5/2);
	2
trunc(-5/2);
	-2

References

Gullberg, Jan. Mathematics: From the Birth of Numbers. Norton, 1996.