Why is double printing the same value as float in C when they have different sizes?
Advertisements I need to do calculations using π. When I checked precision of M_PI, it only printed 7 decimal digits. So I #defined my own MY_PI. But I am still facing the same problem. double should support 15-17 decimal digits. Why am I only getting 6 #define MY_PI 3.1415926535897932384626433832795028841971 #include<stdio.h> #include<math.h> int main() { printf("%f\n%lf\n%20lf\n",M_PI,M_PI,M_PI);… Read More Why is double printing the same value as float in C when they have different sizes?