c/numeric/math/remainder

@1-3@ Computes the IEEE remainder of the floating point division operation. @4@ Type-generic macro: If any argument has type, is called. Otherwise, if any argument has integer type or has type, is called. Otherwise, is called.

The IEEE floating-point remainder of the division operation calculated by this function is exactly the value, where the value  is the integral value nearest the exact value. When $|n-x/y| = ½$, the value is chosen to be even.

In contrast to fmod, the returned value is not guaranteed to have the same sign as.

If the returned value is, it will have the same sign as.

Return value
If successful, returns the IEEE floating-point remainder of the division as defined above.

If a domain error occurs, an implementation-defined value is returned (NaN where supported).

If a range error occurs due to underflow, the correct result is returned.

If is zero, but the domain error does not occur, zero is returned.

Error handling
Errors are reported as specified in.

Domain error may occur if is zero.

If the implementation supports IEEE floating-point arithmetic (IEC 60559),
 * The current rounding mode has no effect.
 * fe_inexact is never raised, the result is always exact.
 * If is ±∞ and  is not NaN, NaN is returned and fe_invalid is raised.
 * If is ±0 and  is not NaN, NaN is returned  and fe_invalid is raised.
 * If either argument is NaN, NaN is returned.