Web lists-archives.com

Re: [Mingw-users] msvcrt printf bug




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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).

- -- 
Regards,
Keith.

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)

iQIcBAEBAgAGBQJYf/Q6AAoJEMCtNsY0flo/6foQAIKcKS3V22Zh4wGNJPnBzRcV
0WmiLpoDevTjAZrOxrKa0SC8Qffk0B0jqxAlYWYt7b5S6LkgfdPq6UBv03MVPZwE
JLeG7KZT2P3vYCQJJ4nDrv29xaDVHC/8atzBLSlP/AXJ+7ulT5aFskLT1tnUtVEd
5ArYipxHj1luzxtd71aO/VKN1LRPuB8wZf5To3wz8SiXlM3ICTB0OTU7fmTmyf55
Heay0he/uLA/MU5Qn7kQTK05wIkJLEHKkdgJV/rlgNBbmvlRjF/ZaYGgV9nI5zxK
3Oy/SbeuV97N89EtuPumOrCCF1jP3DsJ8Oc4GweDZzzXCPOKiNYHMOoKlSVcrwYG
0Y7jNq++5xVam7RNqsJVLPc6VUX3EkMbNuYLBy0dVzabJLwvD48e9kFU4AKj6Kej
FygmAWkbPNpGr9m5w4hx8gD+EgbfBzFccT61ERf1yX4RJ3spTkxBtfQJj+3Zsa8v
zK/5N42A752Gq7POdZ8ZwQ1rmNmwo7rP+IV/bI1lrf0XOy7bN6d9/z0RzcOQ/s4O
oCiCnUahq8uvtEhHLX6xO7IdV0wwGAA1m90p9ERcIeq7H6Q+xi31Apo5wfju2EEG
H3bAOcDNvT4ff+Lv7/8BDOrOOFpkSPy6LR3MHtv+8kUaPOgORRSOxz9GPr/aAuXp
gcuj1lBWXOFUycv41PJC
=/hO4
-----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
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
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:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe