Mark Dickinson added the comment:

The dtoa.c occurrence is also straightforward to fix. It's coming from this 
declaration:

    static const double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128,
                      9007199254740992.*9007199254740992.e-256};

We need to be a tiny bit careful here, since dtoa.c is fragile code and relies 
on exact representation of some floats. But this isn't one of them: the only 
thing that tinytens is used for is getting a first approximation to the correct 
strtod conversion before the main iteration kicks in.

So replacing that last tinytens value with a suitably precise constant should 
be okay. The *exact* value of the constant we need is 0x1.8062864ac6f43p-745, 
or in decimal: 

8.11296384146066798564414657510725945755617084762542409283393077939218873123696010224953185884350111344494845510586594487062499326481633636403965073720792027659736980514301906428513324403012698167973428740345918815412673646248939187125560378562250718330485204443480974365425682653185460026731686712157238961539250106472701178830382576220700577401565213825995547382545061286464557591871221948351734365233811730381171156150018612038234137396963100802781483162471536048255738998621259419238986828005847002315384502722411971989039148624688058131226853220141492784023284912109375E-225

But 8.112963841460668e-225 should be good enough (along with a comment 
explaining why the expression was changed). If MSVC supported C99's hex 
constants, we could just use 0x1.8062864ac6f43p-745. But it doesn't. :-(

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25934>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to