I'm a beginner in programming and I have a question. Mainly, what is the difference in defining PI exactly as I state below;
#define PI (4.*atan(1))
#define PIa 4.*atan(1)
#define PIb 4*atan(1)
I have printed this code:
printf( "%lf\n", 3 / PI );
printf( "%lf\n", 3 / PIa );
printf( "%lf\n", 3 / PIb );
The results are:
0.954930
0.589049
0.000000
According to my calculator the first one is correct, and the rest should also be. Why aren't they?