I've run across a strange issue that's easier to demonstrate than to write out.
Its a macro that converts Celsius to Fahrenheit.
#define CtoF(c) ((c * (1.8)) + 32) // This works as expected
// #define CtoF(c) ((c * (9/5)) + 32) This version fails. Why?
// #define CtoF(c) ((c * 9/5) + 32) // this works
When I try to convert 20C (68F) this is what the result is.
First version: 68
Second version: 52 ?! (almost like c+32 and the rest is ignored).
Why is the formula failing when 9/5 = 1.8 anyway?