Re: [Mingw-users] msvcrt printf bug
-----BEGIN PGP SIGNED MESSAGE-----
On 18/01/17 22:18, Emanuel Falkenauer wrote:
> With all due respect, I think you never got what this is about.
Yes, I did. I fully understood that your holy grail was
consistency, even if that equates to "consistently imprecise",
or "consistently inaccurate". That's absolutely fine, but, once
you go beyond the limit of representable precision inherent in
the underlying data type, you become dependent on fiction; the
only way to guarantee consistency in that fiction is to employ
identically the same algorithm to produce it ... and the further
you go beyond that limit of precision, the less likely it may
become that such consistency is preserved -- realistically, you
should never look more than two digits beyond floor(N*log10(2))
in any case.
So, if you want consistency in printf()'s imprecision, then you
should be using _our_ printf(), (which uses, AFAIK, identically
the same algorithm as both cygwin and GNU's glibc); Microsoft
use their own algorithm, which is thus most unlikely to yield
the same output, _beyond the limit of representable precision_.
My point was that there is a significant volume of ill-informed
nonsense pervading the internet, which encourages the naive, and
the ignorant, to believe that float, double, and long double can
accurately represent many more digits of precision than the
number of available bits in the underlying data type can
physically sustain; I get utterly fed up with dismissing "bug"
reports to the effect that printf( "%.20e", foo ) prints the wrong
value in the least significant digits, when "%.15e" is the most
that can dependably produce _accurate_ results; (the additional
five digits, requested by "%.20e", are speculative).
Public key available from keys.gnupg.net
Key fingerprint: C19E C018 1547 DE50 E1D4 8F53 C0AD 36C6 347E 5A3F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
-----END PGP SIGNATURE-----
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
MinGW-users mailing list
This list observes the Etiquette found at
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.
You may change your MinGW Account Options or unsubscribe at: