c/numeric/math/remquo

@1-3@ Computes the floating-point remainder of the division operation as the remainder function does. Additionally, the sign and at least the three of the last bits of will be stored in, sufficient to determine the octant of the result within a period. @4@ Type-generic macro: If any non-pointer argument has type, is called. Otherwise, if any non-pointer argument has integer type or has type, is called. Otherwise, is called.

Return value
If successful, returns the floating-point remainder of the division as defined in remainder, and stores, in, the sign and at least three of the least significant bits of  (formally, stores a value whose sign is the sign of  and whose magnitude is congruent $modulo 2n$ to the magnitude of the integral quotient of , where $n$ is an implementation-defined integer greater than or equal to $3$).

If is zero, the value stored in  is unspecified.

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 subnormals are supported.

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
 * 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 or  is NaN, NaN is returned