Result is truncate(Number)which should be preferred for portability.
This operation works on all numeric types. The result value is the closest integral value that lies between 0 and Number (rounding towards zero).
The result type is the same as the argument type. To convert the type to integer, use integer/2.
In coroutining mode, if Number is uninstantiated, the call to truncate/2 is delayed until this variable is instantiated.
Result is truncate(1.8). % gives Result = 1.0 Result is truncate(-1.8). % gives Result = -1.0 Result is truncate(1.0). % gives Result = 1.0 Result is truncate(-0.0). % gives Result = -0.0 Result is truncate(5). % gives Result = 5