title: How do I check whether a number is divisible by 2*M_PI in c++?
body: <p>This is what I've done for checking the divisibility of a number by 2*M_PI. "w" is a constant that's 2/3 and t is the variable that varies by t += dt, where dt is 0.1. I'm trying to use the mod operator, %, to see if something is divisible. But its not working.</p>
  
  <p>bool divisible;
  real w = 2/3;
  real t;</p>
  
  <pre><code>if((w*t) % 2*M_PI == 0)
      {
          divisible = true;
      }
  
  else
      {
          divisible = false;
      }
  </code></pre>
  
  <p>This is the error that I get, "invalid operands of types ‘real’ and ‘int’ to binary ‘operator%’"</p>
  
  <p>What does this mean? How do I get this to work? So do I need to make w and t an int? They can't be because w is 2/3, and t increments from 0 by 0.1. Can someone please help me?</p>