Definition | #include <math.h> double nearbyint(double x); (C11) float nearbyintf (float x); (C11) long double nearbyintl (long double x); (C11) The functions return the integer value (displayed as a number of type The returned value is rounded according to the currently set rounding mode of the computer. If the default mode is set to ’round-to-nearest’ and the difference between x and the rounded result is exactly 0.5, the next even integer is returned. If the currently set rounding mode rounds infinitely in the positive direction, |
Return val. | Integer value represented as a floating-point number. |
Notes | In this version the rounding mode is set to positive infinity. |
See also | ceil, floor, rint |