Trunc Procedure

Removes the fractional part and returns the integer part of the given number x.
Declaration
function Trunc(x as Number) as Number

Parameters

Return value

Number — Integer value.

Example

Code
print Trunc(5.4)
print Trunc(5.5)
print Trunc(5.6)
print Trunc(6.4)
print Trunc(6.5)
print Trunc(6.6)
print Trunc(-5.4)
print Trunc(-5.5)
print Trunc(-5.6)
print Trunc(-6.4)
print Trunc(-6.5)
print Trunc(-6.6)
Output
5
5
5
6
6
6
-5
-5
-5
-6
-6
-6