cpp/numeric/math/remquo

@1-3@ Computes the floating-point remainder of the division operation as the std 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. @A@ Additional overloads are provided for all other combinations of arithmetic types.

Return value
If successful, returns the floating-point remainder of the division as defined in std, 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  is an implementation-defined integer greater than or equal to ).

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 math_errhandling.

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