Web lists-archives.com

Re: [Mingw-users] msvcrt printf bug

On 1/16/2017 8:56 AM, John Brown wrote:
> On  Sunday, January 15, 2017 4:59 PM, Keith Marshall wrote:
>> On 15/01/17 21:24, John Brown wrote:
>>> 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).

It's not a perfect discourse that I wrote, so sorry. I was 
shooting the breeze because I was curious to see where it went... 
:-p I promise I will (try) not post anymore to this thread after 
the following.

I do not think there are canonical conversion algorithms that must 
always be upheld, so I did not have an expectation that glibc must 
be canonical.

The glibc result is one data point, msvcrt is also one data point. 
He claims to have his own float to string, but knowing digits of 
precision limitations and the platform difference, why is he so 
strident in knocking msvcrt? Curious. I won't score that, so we 
are left with two data points running what are probably 
non-identical algorithms.

>> 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.
> Yes, you are right on all counts.

To me the "beyond our power" thing is obvious. I was more 
interested in what the OP was trying to do. Hence, shooting the 

It's unclear why he wants to use 19 digit precision test data on 
32-bit float to string. I'm curious, but we may never know. For 
that expectation we pretty much need everyone to be using the same 
conversion algorithm. For perfect round trip conversion, via 
Wikipedia (*cough*) according to Kahan: 9 digits for floats, 17 
digits for doubles. Useful digits in normal use is less, as what 
Keith has said above.

Kein-Hong Man (esq.)
Selangor, Malaysia

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

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:
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe