I'm testing a simple program that converts Fahrenheit to Celsius, using Ruby.
This code returns 36.999999999 in terminal.
def ftoc(far)
return (far-32)/1.8
end
ftoc(98.6)
This code returns 37.
def ftoc(far)
return (far-32)*(5.0/9)
end
ftoc(98.6)
Can anyone tell me why? Thanks!!