### FMOD function

Hello, I used the fmod function and I am confuse about the result.
 ``12345678910111213141516171819202122232425262728`` ``````// Sequencia ij 4 #include #include #include int main () { double i=0, j=1, n=1; while (i<=2) { if (fmod(i,1) == 0 && fmod(j,1) == 0) printf ("I=%.0lf J=%.0lf\n", i, j); else if (fmod(j,1) == 0 && fmod(i,1) != 0) printf ("I=%.0lf J=%.1lf\n", i, j); else if (fmod(i,1) == 0 && fmod(j,1) != 0) printf ("I=%.0lf J=%.1lf\n", i, j); else printf ("I=%.1lf J=%.1lf\n", i, j); j+=1; if (j>n+2) { n+=0.2; j=n; i+=0.2; } } return 0; }``````

Porém a saída é a seguite:

 ``123456789101112131415161718192021222324252627282930313233`` ``````I=0 J=1 I=0 J=2 I=0 J=3 I=0.2 J=1.2 I=0.2 J=2.2 I=0.2 J=3.2 I=0.4 J=1.4 I=0.4 J=2.4 I=0.4 J=3.4 I=0.6 J=1.6 I=0.6 J=2.6 I=0.6 J=3.6 I=0.8 J=1.8 I=0.8 J=2.8 I=0.8 J=3.8 I=1 J=2.0 I=1 J=3 I=1 J=4 I=1.2 J=2.2 I=1.2 J=3.2 I=1.2 J=4.2 I=1.4 J=2.4 I=1.4 J=3.4 I=1.4 J=4.4 I=1.6 J=2.6 I=1.6 J=3.6 I=1.6 J=4.6 I=1.8 J=2.8 I=1.8 J=3.8 I=1.8 J=4.8 I=2.0 J=3.0 I=2 J=4.0 I=2 J=5.0``````

Não entendi o porque :
I=1 J=2.0
I=1 J=3
I=1 J=4
Sendo que:
fmod(numer, denom) -- http://www.cplusplus.com/reference/cmath/fmod/

fmod = numer - tquot * denom

tquot = numer/denom

Nesta sequencia J tem o valor de 2.0000 entao:

fmod = 2 - (2/1) * 1 = 0

Pq esta resultando fmod = 1?

Pelo que eu entendi, deveria ser 0.
Alguem pode me ajudar.