RFC/RFA: strtod() magnitude problem
nick clifton
nickc@redhat.com
Tue Apr 23 16:21:00 GMT 2013
Hi Corinna,
> Can you try if the below patch fixes the issue? It's just a manual
> update of strtod (or rather _strtod_r) to the latest implementation
> from NetBSD. There were a few changes which might explain your problem
> as well as the one encountered by Christian Bruel.
It does - although I had to tweak it slightly. (Tweaked version
attached). There was one place I found where the dword1() macro was
being used unsafely. The attached patch includes a fix for this. There
are other places where dword1() is used without checking
DOUBLE_IS_32BITS, but these places are safe.
One point - this part of your patch:
> static _CONST double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128,
> - 9007199254740992.e-256
> + 9007199254740992.*9007199254740992.e-256
> };
appears to be a typo. I have removed it in my revised patch, but maybe
it needs fixing ?
Cheers
Nick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: strtod.c.patch
Type: text/x-patch
Size: 8941 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20130423/7f483604/attachment.bin>
More information about the Newlib
mailing list