Mail Archives: djgpp-workers/2003/10/24/15:49:33.1
Hello.
ams AT ludd DOT luth DOT se wrote:
>
> According to Richard Dawe:
> > The strtod test (tests/libc/ansi/stdlib/strtod.c) seems to take a long
> > time.
>
> I've seen this too. And in my case it's gcc 2.95.{2,3}.
>
> > DJGPP CVS built with gcc 3.2.2, binutils 2.13 on an Athlon 850MHz:
> >
> > bash-2.04$ time ./strtod.exe
> > 0e20 -> 0
> > 1e200 -> 1e+200
> > 0e2000000000 -> 0
>
> IIRC, this was a bad one considering the result should be 0 which
> can be seen early.
>
> > I'm wondering if we could exit strto* faster, when the exponent is larger
> > than one we support (*_MAX_EXP from <float.h>.
>
> Sounds good.
Unfortunately I don't think is as simple as it sounds. Consider a number like
this:
0.0000000000000000000000000000000000000000000000006e309
Considering the exponent alone, you would think that the number is greater
than that allowed for double. But it's a valid double, after you've cancelled
powers of 10 from the decimals and the exponent.
I guess we could count the number of zeroes after the decimal point and use
that in some calculation with the exponent.
I'm not sure I want to mess with this just before a beta.
Bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
"You can't evaluate a man by logic alone." -- McCoy, "I, Mudd", Star Trek
- Raw text -