Important: The information in this document is obsolete and should not be used for new development.
Rounding Floating-Point Numbers to Integers
MathLib provides six functions that convert floating-point numbers to integers and return the integer in a floating-point type. The first is therint
function, which performs the round-to-integer operation as described in Chapter 6, "Numeric Operations and Functions." The other functions either round in a specific direction or perform a variation of therint
operation.
Returns the nearest integer not less than x. Returns the nearest integer not greater than x. Returns the nearest integer to x in the current rounding direction. Adds 1/2 to the magnitude of x and chops to an integer. Truncates the fractional part of x.