c/numeric/math/rint

@1-3@ Rounds the floating-point argument to an integer value in floating-point format, using the current rounding mode. @5-7, 9-11@ Rounds the floating-point argument to an integer value in integer format, using the current rounding mode. @4,8,12@ Type-generic macros: If has type, , ,  is called. Otherwise, if has integer type or the type, , ,  is called. Otherwise,, , is called, respectively.

Return value
If no errors occur, the nearest integer value to, according to the current rounding mode, is returned.

Error handling
Errors are reported as specified in.

If the result of or  is outside the range representable by the return type, a domain error or a range error may occur.

If the implementation supports IEEE floating-point arithmetic (IEC 60559),
 * For the function:


 * If is ±∞, it is returned, unmodified
 * If is ±0, it is returned, unmodified
 * If is NaN, NaN is returned
 * For and  functions:


 * If is ±∞, fe_invalid is raised and an implementation-defined value is returned
 * If the result of the rounding is outside the range of the return type, fe_invalid is raised and an implementation-defined value is returned
 * If is NaN, fe_invalid is raised and an implementation-defined value is returned