Result is round(Number)which should be preferred for portability.
This operation works on all numeric types. The result value is the integral value that is closest to Number (rounding to nearest). If Number is exactly in the middle between two integers, the result is the even one.
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 round/2 is delayed until this variable is instantiated.
Success: round(1.49, 1.0). round(1.5, 2.0). (odd integer part) round(2.5, 2.0). round(2.51, 3.0). (even integer part) round(3.5, 4.0). round(-6.4, Result). (gives Result = -6.0) round(3, 3). Fail: round(1, 0.0). round(0.5, 0). round(1, r). Error: round(A, 6.0). (Error 4). round(4 + 2.3, 6.0). (Error 24).