title: Convert negative angle to positive: Involves invalid operand use
body: <p>I am attempting to convert a negative angle (in degrees) to positive. But I am getting a compile error saying:</p>
  
  <blockquote>
    <p>test.cpp invalid operands of types 'double' and 'int' to binary 'operator%'<br>
    test.cpp invalid operands of types 'float' and 'int' to binary 'operator%'</p>
  </blockquote>
  
  <p>My code:</p>
  
  <pre><code>double to_positive_angle(double angle)
  {
     return ((3600000 + angle) % 360);
  }
  
  float to_positive_angle(float angle)
  {
     return ((3600000 + angle) % 360);
  }
  </code></pre>
  
  <p>Its obviously because I am trying to use the Modulus operator on a Float and Double. </p>
  
  <p>Are the any ways I can successfully convert a negative angle (float) to a positive one (float)? Or ways that I can overcome the modulus compile error?</p>