Help with numbers

This should be an easy one for someone....

When _defaultRPM = 6, the following formula returns 5.78. Great.

      double _lunarRPM = _defaultRPM * 0.964;

When _defaultRPM = 6, the following formula returns 0. Bad.

      double _lunarRPM = _defaultRPM * (27/28);

Why - what's the difference? between 0.964 and (27/28)? What do I change to get (27/28) to work?

27/28 is zero, by the rules of integer division.

27.0/28.0 is a floating point number, close to 1.0.

1 Like

Awesome, thank you!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.