cpp/numeric/math/fmod

@1-3@ Computes the floating-point remainder of the division operation.

The floating-point remainder of the division operation calculated by this function is exactly the value, where  is  with its fractional part truncated.

The returned value has the same sign as and is less than  in magnitude.

Return value
If successful, returns the 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 (after rounding) 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),
 * If is ±0 and  is not zero, ±0 is returned
 * 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 is ±∞ and  is finite,  is returned.
 * If either argument is NaN, NaN is returned