[Top][All Lists]

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

Re: A BUG of 64-bit integer addition

From: Aharon Robbins
Subject: Re: A BUG of 64-bit integer addition
Date: Sun, 20 Apr 2008 22:57:18 +0300

In article <address@hidden> you write:
>Steffen Schuler schrieb:
>> gawk uses internally the C-type double also for integer calculation with a
>> mantissa of 53 bit length.
>> (AMD Athlon, Linux, gcc 4.2.3, gawk-3.1.6a)
>> The result of your addition would need 54 bit.
>> As long as gawk uses the C-type double you have to live with this error.
>This is not an error, but a feature.
>As far as I know, it is intentional that gawk uses 
>a portable data type that produces the same result
>on every machine.

Double isn't necessarily portable (e.g., IBM S/390) but on most modern systems
it is. The reason for use of double is both historical practice and mandate

Aharon (Arnold) Robbins                                 arnold AT skeeve DOT com
P.O. Box 354            Home Phone: +972  8 979-0381    Fax: +1 206 202 4333
Nof Ayalon              Cell Phone: +972 50  729-7545
D.N. Shimshon 99785     ISRAEL

reply via email to

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