lundi 8 juin 2015

If statement doesn't catch a module division condition

i don't understand the reason why the following code doesn't enter in the if condition neither when the remainder is equal to zero (i see that by means of the last "cout"). Of course this code is inside a for cycle on the "frameIdx" variable.

if (((frameIdx - 1) % step) == 0)
        {
            cout << "I get the index\t" << frameIdx << endl;
            getchar();
        }

cout << "Index\t" << frameIdx << "\t\tmodule" << ((frameIdx - 1) % step) << endl;

Aucun commentaire:

Enregistrer un commentaire