% not usable on double options?

I now understand % is not usable on double values, is there anyway around this because if I set the variable to an integer type my whole code messes up.

1
2
3
4
  if(counter % 5 != 0)
    {
        cout << setw(15) << counter << setw(15) << fallDist << endl;
    }
Possibly https://en.cppreference.com/w/cpp/numeric/math/fmod
But it really sounds like a design problem.
Topic archived. No new replies allowed.