educative.io

Solution review Temperature Conversion

When trying to solve the Fahrenheit to celsius problem. The following two formula generate different results for a Fahrenheit value of 35.5. Why is that so, any clue?
Celsius = (Fahrenheit-32)*(5/9)
Celsius =(Fahrenheit-32)*5/9

The values generated are
1.9444444444444446
1.9444444444444444

1 Like

I have the same question. guess because the first one computes 5/9 first it generates some other values for bits first and doesn’t encounter floating-point problem.