Quote:
Originally Posted by
shamrock
Except when it comes to the degree of precision desired...old compilers used to automatically convert floats to doubles but that is no longer practised and if that is indeed the case then all the more reason to use the double format specification instead of the float.
I'm
not saying float and double are the same. I'm saying %f is capable of handling double-precision numbers.
Consider that %f works with doubles and floats even though they're different sizes. stdargs has no way to warn printf which is used, so the compiler must be converting them to something consistent. So if double-precision works in printf at all, they're
all being passed as doubles, and all being
used as doubles, not floats.