View Single Post
  #3 (permalink)  
Old August 6th, 2009, 07:28 PM
Lloydering2 Lloydering2 is offline
Registered User
 
Join Date: Aug 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by DrPurdum View Post
The reason it failed was because you used integer data types for the formula. When you converted 5/9 and assigned it into an integer data type, because integers can't express a fractional value, the result was zero. From that point on, you were working with zero for that result. If you change things to use the double data type, it would have worked correctly.
Ok that answers my question of why the first formula didnt work but doesnt explain why when i took the same formula and switched it around (still using the int variables) it seems to work.

Isn't: Celcius = 5/9 * (Farenheight -32); &didnt work with int.
Celcius = (Farenheight - 32) * 5 / 9; did work with int.
Aren't those two formulas the same thing? one didnt work one did. I don't understand why?