Web lists-archives.com

Re: [Mingw-users] msvcrt printf bug




Keith, have a look here please:
http://www.exploringbinary.com/quick-and-dirty-floating-point-to-decimal-conversion
Quote from the article:
>>>Every binary floating-point number has an exact decimal equivalent, which can be expressed as a >>>decimal string of finite length.

When I started this, I didn't know about this article. Also another in-depth look at float to decimal conversion from the same author:
http://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers
Anyway, your solution to define _XOPEN_SOURCE does exactly what I initially needed, so thank you again.


--
Securely sent with Tutanota. Claim your encrypted mailbox today!
https://tutanota.com

19. Jan 2017 00:18 by mingw-users-request@xxxxxxxxxxxxxxxxxxxxx:


Message: 2
Date: Wed, 18 Jan 2017 21:39:22 +0000
From: Keith Marshall <keithmarshall@xxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [Mingw-users] msvcrt printf bug
To: mingw-users@xxxxxxxxxxxxxxxxxxxxx
Message-ID: <587FE08A.4080301@xxxxxxxxxxxxxxxxxxxxx>
Content-Type: text/plain; charset=utf-8

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

Guys,

This thread now seems to have run its course; sadly, the level of
pervasive wide-spread ignorance it has demonstrated is depressing.
[...]
Yes, I deliberately said "consistently inaccurate"; see, cygwin's
printf() is ABSOLUTELY NOT more accurate than MinGW's, (or even
Microsoft's, probably, for that matter). You keep stating these
(sadly all too widely accepted) myths:
Every valid floating point representation that is not NaN or inf
corresponds to an exact, non recurring fraction representation in
decimal.

In the general case, this is utter and absolute nonsense! Sure,
there are a few cases where it may be true -- cases which are
limited to those where the number of significant decimal digits generated does not exceed the representable precision of the
available binary digits within the underlying data type, AND the
significant digits of the represented value, when considered as
an unsigned integer, (after conversion of the exponent from base
two to base ten), are evenly divisible by ten, with no remainder.
In ALL other cases, (by far the majority), the value represented
is INEXACT.

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