Web lists-archives.com

Re: [Mingw-users] msvcrt printf bug




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

On 15/01/17 21:24, John Brown wrote:
> On Saturday, January 14, 2017 10:17 AM, KHMan wrote:
>> On 1/14/2017 10:02 PM, tei.andu@xxxxxxxxxxxx wrote:
>>>
>>> Hello,
>>> I encountered a loss of precision printing a float with C printf.
>>> For values greater than or equal to 1.743397235870361328125 * 2 ^
>>> 59 (0x5D5F27A4) the printed value is slightly wrong. The error
>>> increases with increasing input.
> 
>> The output is fine. When the 32 bit float is converted into 64
>> bits and then printed, it should be accurate up to about 17
>> digits. I would not trust anything beyond 17 digits with my
>> favorite teddy bear.
>>
>> Why should one expect 19 digits of precision? Also, one should not
>> expect 8087's extended precision registers to be used anymore
>> unless it is explicitly required.
> 
> You have skillfully avoided addressing the fact that it works as the
> original poster expects with glibc 2.2.5 (tested on Linux / glibc 2.19).

And you've both dodged the utter irrelevance of the entire issue;
the OP noted that the claimed "bug" is in MSVCRT.DLL, so completely
beyond our power to do anything about it.  In reality, the issue
boils down to unrealistic expectations regarding _reproducible_
precision of floating point numbers: how can a representation with
only 53 bits _exactly_ record any more than 15 decimal digits?  If
differing output implementations produce differing rounding effects
beyond 15 significant decimal digits, that's hardly a bug; it is,
rather, a limitation of the underlying data representation.

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

iQIcBAEBAgAGBQJYe/CsAAoJEMCtNsY0flo/KwkQAI6Eh3pom7oW1OqM6E5CwqOT
h7ZToo+YlmmvqPITw0/bg+5bQ3tRbEJ8qXU+nk+maFV74SljAubc9rJGAzpLvlYH
WLi1VNwQYmN0bI8TNY1aHACyiwc/iscgYTtqgIiE4smW54GAfhYkCfOONXmfHzz2
yMtFIQqMxcp7jYnkd1OSvgFa7gPThZBm/50EgxoXrufnbLn4NefJpSzc7bFh5bsh
PHSmgHgZ11Dnt/xCZT19E8eTcv9NWG3RpqlQBKtxYSfHiBzw1QZzL++fbe9KRzN+
8nbvngRsk76tXSJr9GyzRQboqqE2sxea4OJqMfQStrrbcFSdvSQE7b51dzSGrlh9
yhV9sxzgld+8B3RFr/uVhyPNs4OjokS+WEqr5DE5zukaIuvn33B/VZJtp1oUTkpR
PLUK22XMuEVnvPZ37WVJzh3XQBXSM3r9pcrX8XDjnKjyM++u3LJZSzWJJ/wB8OlD
BcHH8m9nRWGhTlo+VWJ64VkHav6ZAgVp1I2okFkdt+yw6bxdqLSGh0XU+8OUd+DX
yBFspjgBiQtTpp1ict2+sABO9zS+vK0puXiYwdaQhJlgSYRhVVUlV/QK/JMFJSVb
9EKRcFaPynkEdGN9WHtWwSiLxPDfYh1MPemwdwF98Ve4SP4DBDzpUd/C5QJopB3R
M7hgyP9vkicmw3yKHhvm
=QCjg
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
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