long double I = 0;
I = 0.01902*pow(0.00318,3)/12;
At this moment, I
's value is approximately 5.096953e-11
. Then...
printf("%Lf\n", I);
The sole format specifier in this printf()
call is %Lf
. This indicates that the argument is a long double
(L
), and that it should be printed as a floating-point number (f
). Finally, as the precision (number of digits printed after the period) is not explicitly given, it is assumed to be 6
. This means that up to 6 digits will be printed after the period.
There are several ways to fix this. Two of them would be...
printf(".15Lf\n", I);
This will set the precision to be 15
. As such, 15 digits will be printed after the period. And...
printf("%Le\n", I);
This will print the number in scientific notation, that is, 5.096953e-11
. It too can be configured to print more digits if you want them.