Consider: #define T1 20/3 Evaluated on its own that will be truncated to 6, whereas 20.0/3.0 will give the correct value. But also consider: 2*PI*t/T1 Using the above defined value for T1 that becomes: 2*PI*t/20/3 = (2*PI*t/20)/3 = (2*PI*t)/(20*3) which is not correct. The correct way to define T1 is: #define T1 (20.0/3.0)