Greetings, I have two methods one for converting celsius to farenheit and the other method to convert farenheit to Celsius. I am not having the best of luck with these methods. The equations (listed below) are improperly converting the units. I believe that there may be a possible issue with the way the formulae is written. Can some of you heroes please help assess the code for possible solutions.
Carey Brown wrote:You want 5.0/9.0
As you have it it performs integer division resulting in zero.
Excellent, thank you very much for help. I guess that I forgot you can not divide an integer with a double. Thanks for the reminder.
Well, yes you can divide an integer with a double, and in that case the integer will be promoted to a double before the divide takes place. Eg 5.0/9
What you have is integer divided by an integer which will throw away any fractional part.