c/numeric/math/round

@1-3@ Computes the nearest integer value to (in floating-point format), rounding halfway cases away from zero, regardless of the current rounding mode. @5-7, 9-11@ Computes the nearest integer value to (in integer format), rounding halfway cases away from zero, regardless of 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, rounding halfway cases away from zero, is returned.

If a domain error occurs, an implementation-defined value is returned.

Error handling
Errors are reported as specified in math_errhandling.

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, , and function:


 * The current rounding mode has no effect.
 * If is ±∞, it is returned, unmodified
 * If is ±0, it is returned, unmodified
 * If is NaN, NaN is returned
 * For and  families of functions:


 * fe_inexact is never raised
 * The current rounding mode has no effect.
 * 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