title: error C2296: '%' : illegal, left operand has type 'double' in C++
body: <p>I have to use '%' with double numbers, but in C++ it doesn't work.
  Example:</p>
  
  <pre><code>double x;
  temp = x%10;
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>error C2296: '%' : illegal, left operand has type 'double' 
  </code></pre>
  
  <p>How can I solve this problem without converting the number from double to integer?
  If I converted it, I will lose the fractional part, and I don't want.</p>
  
  <p>Is there another alternative?</p>