X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f Sender: rich AT phekda DOT freeserve DOT co DOT uk Message-ID: <3F997F7B.2EA5BEE7@phekda.freeserve.co.uk> Date: Fri, 24 Oct 2003 20:37:31 +0100 From: Richard Dawe X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr MIME-Version: 1.0 To: djgpp-workers AT delorie DOT com Subject: Re: strtod test takes a long time References: <200306291425 DOT h5TEP4iB021922 AT speedy DOT ludd DOT luth DOT se> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com 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 . > > 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