For the following snippet of code:
long double foo = 5.32e-5;
double bar = foo ;
printf("%Lf can be written %Le\n", foo, foo);
printf("%f can be written %e\n", bar , bar);
I'm getting this output:
-1950228512509697500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000 can be written 2.725000e+002
0.000053 can be written 5.320000e-005
foo has been converted to bar without issue, this makes me think that the internal representation of the variable is fine, but when I print both these variables bar has an accurate representation and foo does not.
I believe the formats %Lf and %Le are correct, however I get the same output if I use the lowercase (%lf and %le). I am using gcc on a window computer.