In using double fmod(double x, double y) and y is an integer, the result appears to be always exact.
double fmod(double x, double y)
y
(That is y a w
The result of fmod is always exact; whether y is an integer is irrelevant. Of course, if x and/or y are already approximations of some real numbers a and b, then fmod(x,y) is unlikely to be exactly equal to a mod b.
fmod
x
a
b
fmod(x,y)
a mod b