round
round(n_arg) =>x_result
Description
Rounds a floating-point number to its closest integer value. If the given floating point argument n_arg is greater than the maximum integer value INT_MAX, a warning message displays and the INT_MAX value is returned. Similarly, if the floating point argument n_arg is less than the minimum integer value INT_MIN, a warning message displays and the INT_MIN value is returned.
Arguments
Value Returned
Examples
round(1.5)
=> 2
round(-1.49)
=> -1
round(1.49)
=> 1
round(1.111111e10)
=>2147483647
round(-1.1234e20)
=>-2147483648
Related Topics
Return to top