title: Invalid operands of type 'double' and 'int' to binary 'operator%'
body: <p>I'm writing a program for my control structures class and I'm trying to compile it.  The only error, at least the only error the compiler is picking up is saying invalid operands of types 'double' and 'int' to binary 'operator%'.  Most of the program isn't included since it's too long and doesn't really pertain to this problem, at least I don't believe.</p>
  
  <pre><code>double maxTotal, minTotal;
  
  cin &gt;&gt; maxTotal &gt;&gt; minTotal;
  
  int addCalc;
  
  static_cast&lt;int&gt;(maxTotal);
  
  if(maxTotal % 2 == 1)
       addCalc = minTotal;
  else
       addCalc = 0;
  </code></pre>