As of Jan. 06 2023. Changelog from http://netlib.org/fp/changes (filtered):
20121220
dtoa.c and gdtoa.tgz: to avoid a possible one-time race when
Infinity or NaN appear in decimal->binary conversions done in parallel
threads, replace hexdig_init() with static initialization.
20131209
dtoa.c, gdtoa.tgz: when strtod computes its starting approximation,
allow z to involve one more digit for IEEE arithmetic and two more
digits for IBM-mainframe and VAX arithmetics. Thanks to Walter Qian
(water.qian@gmail.com) for suggesting this change, which makes some
conversions faster.
20151020
dtoa.c: add a test for dtoa() to return "1" under mode 4 when
converting some very small powers of 10, such as 1e-322 with
ndigits = 4 and 1e-319 with ndigits = 7 (examples provided by
jay.foad@gmail.com).
20160219
gdtoa.tgz: Adjust gdtoa(...,mode,...) to assume
"round near" when mode is 0 or 1. Make various tweaks to banish
(useless) warnings from "gcc -Wall -Wextra". Thanks to Jarkko
Hietaniemi <jhi@iki.fi> for advocating the latter exercise (and
correcting a typo in README).
20160307
dtoa.c: fix glitches with floating-point values in hexadecimal
notation: some values that should overflow to (appropriately signed)
Infinity, such as 0x1p1025, were mishandled, and values greater than
0x1p-1075 and less than 0x1.0000000000001p-1075 where treated as zero
rather than the smallest denormal number.
gdtoa.tgz: fix a bug with hexadecimal input greater than the
smallest denormal and less than the smallest denormal times the
smallest number greater than one. In round-to-nearest values, such
values should round to the smallest denormal rather than to zero.
Thanks to Albert Chan <albertmcchan@yahoo.com> for bug reports.
20160325
dtoa.c: fix a bug whereby dtoa(...,mode,...) with, e.g., mode = 2 or
3 could return a string with trailing zeros, contrary to specification.
An example provided by Albert Chan: dtoa(81320560005., 2, 10,...).
gdtoa.tgz: fix the analogous bug in gdtoa/dtoa.c and gdtoa/gdtoa.c
and apply the bug fix of 20151020 to gdtoa/dtoa.c.
20160429
dtoa.c, gdtoa.tgz (file dtoa.c): Fix a bug with dtoa mode 0 when
Honor_FLT_ROUNDS is defined: with some inputs and nondefault rounding
modes (e.g., 1.23 with round toward zero), the returned string was off
by one. When the new 64-bit integer logic is used, the test in
question is very unlikely to be used. This is another bug reported by
Albert Chan.
20160505
dtoa.c: fix some glitches in strtod() when Honor_FLT_ROUNDS is
defined: zero was returned for some decimal values that should have
been rounded to +- the smallest denormal, and +-Infinity was returned
for some hexadecimal strings with huge values that should have been
rounded to +- the largest finite value.
20160506
gdtoa.tgz: analogous bug fixes to those of 20160505.
20180730
strtodg.c in gdtoa.c: fix a glitch, introduced 20160506, with some
return values of +-Infinity: the STRTOG_Overflow bit was not set.
gdtoa/gethex.c: In function ‘__gethex_D2A’:
gdtoa/gethex.c:127:10: warning: this statement may fall through [-Wimplicit-fallthrough=]
esign = 1;
~~~~~~^~~
gdtoa/gethex.c:129:5: note: here
case '+':
^~~~
gdtoa/dtoa.c: In function ‘__dtoa’:
gdtoa/dtoa.c:284:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
leftright = 0;
~~~~~~~~~~^~~
gdtoa/dtoa.c:286:3: note: here
case 4:
^~~~
gdtoa/dtoa.c:292:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
leftright = 0;
~~~~~~~~~~^~~
gdtoa/dtoa.c:294:3: note: here
case 5:
^~~~
gdtoa/gdtoa.c: In function ‘__gdtoa’:
gdtoa/gdtoa.c:272:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
leftright = 0;
~~~~~~~~~~^~~
gdtoa/gdtoa.c:274:3: note: here
case 4:
^~~~
gdtoa/gdtoa.c:280:14: warning: this statement may fall through [-Wimplicit-fallthrough=]
leftright = 0;
~~~~~~~~~~^~~
gdtoa/gdtoa.c:282:3: note: here
case 5:
^~~~
gdtoa/strtodg.c: In function ‘__strtodg’:
gdtoa/strtodg.c:311:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
sign = 1;
~~~~~^~~
gdtoa/strtodg.c:313:3: note: here
case '+':
^~~~
gdtoa/strtodg.c:314:7: warning: this statement may fall through [-Wimplicit-fallthrough=]
if (*++s)
^
gdtoa/strtodg.c:317:3: note: here
case 0:
^~~~
gdtoa/strtodg.c:413:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
esign = 1;
~~~~~~^~~
gdtoa/strtodg.c:414:4: note: here
case '+':
^~~~
Signed-off-by: LIU Hao <lh_mouse@126.com>
This avoids linker conflicts if object files refer to both 'strtold'
or 'wcstold' and include them from libucrt*.a before other object
files pull in the __mingw_* counterparts.
Signed-off-by: Martin Storsjö <martin@martin.st>
The second implementation, which was under the 'strtold' name, was
lacking (it didn't support e.g. strings like "0x125p-1"), while the
'__mingw_strtold' one seemed correct and complete.
Signed-off-by: Martin Storsjö <martin@martin.st>
The __mingw_*scanf functions use __mingw_strtold for both double and
long double output, but previously the __mingw_strtold function
produced the x86 80 bit long double format, regardless of architecture.
Instead skip the function that produces 80 bit doubles, and make
__mingw_strtold an alias for __mingw_strtod.
Signed-off-by: Martin Storsjö <martin@martin.st>
2011. Changelog from http://netlib.org/fp/changes :
Add field int_max to struct FPI and adjust gdtoa.c and *fmt.c
so gdtoa.c tests against fpi->int_max rather than Int_max. This
only affects some conversions by g_ffmt.c, which in some cases
produced too many digits.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@4577 4407c894-4637-0410-b4f5-ada5f102cad1
match the latest version at netlib.org as of 2011-03-21.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@4151 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/g_dfmt.c (__g_dfmt): Set the STRTOG_Neg flag for __gdtoa()
call if sign is found.
* gdtoa/dtoa.c (__dtoa): Fix bugs with -DROUND_BIASED.
* gdtoa/gdtoa.c (__gdtoa): Likewise.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@3617 4407c894-4637-0410-b4f5-ada5f102cad1
official release at netlib.org/fp as of Jan. 23, 2010. thusly
adjusted the README.mingw file.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@1813 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/strtof.c (__strtof): Pre initialize local variable u to
avoid warning.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@968 4407c894-4637-0410-b4f5-ada5f102cad1
FR/2619978:
* mingw-w64-crt/gdtoa/strtof.c, mingw-w64-crt/gdtoa/strtopx.c: Prepend
the strtof and strtold symbols with '__mingw_' to provide both of strtof
and strtold which rely on msvcrt, and __mingw_strtof and __mingw_strtold
which rely on the internal gdtoa library.
* mingw-w64-headers/include/stdlib.h: Properly provide the prototypes
for __mingw_strtof and __mingw_strtold.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@811 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/misc.c: Sync'ed with the netlib.org sources from April 20, 2009.
The author's changelog states: "do not attempt to allocate large memory
blocks from the private memory pool (which was an unlikely event, but a
bug)."
* gdtoa/strtopx.c: Sync'ed with the netlib.org sources from April 20, 2009.
The author's changelog states: supply explicit bit for Infinity. "Note
that the Q routines (which do not supply this bit) are appropriate for
Sparc quad precision (probably known as long double with most current
compilers)."
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@810 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/gdtoa.h: Go back to defining 'Long' as 'long' instead of int
in order to maintain compatibility and avoid compiler warnings.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@809 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/strtopx.c: All references I found indicate that the
mainstream code is correct of the STRTOG_Infinite case. See, for
example, http://docs.sun.com/source/819-3688/data.rep.app.html
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@800 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/gdtoaimp.h, gdtoa/gethex.c, gdtoa/strtodg.c: Defined a
SET_ERRNO() macro for less ifdefs in actual C code.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@799 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/g_xfmt.c: Added maintream code for general purposes and kept
our fpclassiy() code for mingw builds.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@795 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/gdtoaimp.h, gdtoa/g_dfmt.c, gdtoa/misc.c: Reduce Kmax, and use
MALLOC and free for huge blocks, which are possible only in pathological
cases, such as dtoa calls in mode 3 with thousands of digits requested,
or strtod() calls with thousand of digits. from the netlib.org sources.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@794 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/README, gdtoa/gdtoaimp.h, gdtoa/gethex.c, gdtoa/g__fmt.c,
gdtoa/strtodg.c: Merged the locale-specific decimal point character
cache code from netlib.org. We are building with NO_LOCALE_CACHE,
though, because when user alters the decimal point in locale during
the execution of a program, we wouldn't do the desired thing.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@793 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/qnan.c: Added a comment about why the union has an array of 8
instead of 5.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@792 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/strtopx.c: Added the maintream code of case STRTOG_Infinite
in commented out form: it makes out of Infinite a Zero value. Until
we know better we should keep our version.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@791 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/README, gdtoa/g__fmt.c, gdtoa/g_dfmt.c, gdtoa/g_ffmt.c,
gdtoa/g_xfmt.c, gdtoa/gethex.c, gdtoa/smisc.c, gdtoa/strtodg.c,
gdtoa/gdtoa.h, gdtoa/gdtoaimp.h: Merged the locale-specific decimal
point fixes from netlib.org: if compiled with -DUSE_LOCALE, use the
current locale's decimal point character string. bufsize changed from
unsigned to size_t. g__fmt() now explicitly checks bufsize. fix
glitches in the strto* routines when compiled with -DUSE_LOCALE and
the locale's decimal-point string is two or more characters long.
The mingw build does compile with USE_LOCALE and was exposed to this
bug.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@788 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/gethex.c: fix an off-by-one bug in a rounding test. merge the
rest of the rounding stuff. (from netlib.org sources.)
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@785 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/strtodg.c: Merge the rest of the rounding changes since the
commit rev.776.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@782 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/gethex.c (gethex): Use ULbits as the multiplier, not 32 (from
netlib.org sources.)
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@781 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/strtodg.c: fix a botch in the test of whether to increase
rvbits before terminating the big for(;;) loop with dsign true (from
netlib.org sources.)
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@780 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/gdtoa_fltrnds.h: New.
* gdtoa/README, gdtoa/g_dfmt.c, gdtoa/g_ffmt.c, gdtoa/g_xfmt.c,
gdtoa/gdtoaimp.h, gdtoa/strtof.c, gdtoa/strtopx.c: Merged in the
Honor_FLT_ROUNDS/fegetround() bits from the current netlib.org sources.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@776 4407c894-4637-0410-b4f5-ada5f102cad1
* gdtoa/gdtoa.c: Sync'ed with the netlib.org sources.
git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@774 4407c894-4637-0410-b4f5-ada5f102cad1