We can convert a temperature F, expressed in degrees on the Farenheit scale, to degrees Centigrade by the formula: which renders in code as
Note, by the way, the use of the constants "5.0" and "9.0" rather than just "5" and "9". That’s actually important. 5.0/9.0 is a floating point calculation that yields a floating-point answer of approximately 0.5556. But 5/9 is an integer calculation that truncates any fractional part and actually returns an answer of 0.So if we had written
then, no matter how hot it gets on the Farenheit scale, we would think it’s still freezing in Centigrade!