[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strtod [was: M4 1.4.14 on AIX 7.1BETA]

From: Eric Blake
Subject: Re: strtod [was: M4 1.4.14 on AIX 7.1BETA]
Date: Thu, 29 Jul 2010 08:38:39 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100720 Fedora/3.1.1-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.1.1

On 07/29/2010 08:33 AM, Rainer Tammer wrote:
>>     ASSERT (result == 10.0);
>> Weird - I've never seen that line fail before.  If you have a debugger,
>> can you put a breakpoint on that line and print the actual value of
>> result? 
> I can do that.
> main(), line 234 in "test-strtod.c"
> (dbx) print result
> 10.000000000000002

Yep - rounding inaccuracies have crept in, even for something as simple
as 1 * pow(10,1).  Which gives me hope that latest gnulib will be
immune, since we ditched pow().  But it also makes me wonder who's at
fault for introducing a rounding error on such a seemingly simple
operation - hardware, compiler, or former gnulib algorithm?

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]