Reading through the C specs I found this function:
double remquo(double x, double y, int *quo);
float remquof(float x, float y, int *quo);
long double remquol(long double x, long double y,
int *quo);
The
remquofunctions compute the same remainder as theremainderfunctions. In the object pointed to by quo they store a value whose sign is the sign ofx/yand whose magnitude is congruent modulo 2^n to the magnitude of the integral quotient ofx/y, where n is an implementation-defined integer greater than or equal to 3.The
remquofunctions returnxREMy. Ifyis zero, the value stored in the object pointed to byquois unspecified and whether a domain error occurs or the functions return zero is implementation defined.
I understand what it returns, it returns fmod(x, y), but I don't understand the whole quo part. Is it semantically equal to this?
*quo = (int) x/y;
*quo %= n; /* n implementation defined */
And my last question, for what could this function be useful?