bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: gawk number to string bug


From: Paul Eggert
Subject: Re: gawk number to string bug
Date: Mon, 19 Dec 2005 16:49:43 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> Hold it right there: if we need to cater only to C9x, then we could
> convert to `long long' and be done with it.

That would work for his platform, but it wouldn't work in general.
For example, gawk has some (currently commented-out) code aiming to
support long double, and long double is 128 bits on some platforms, so
with a 64-bit long long (and the commented-out code) the problem would
recur, even if you can assume C9x.  And in theory the problem could
recur even without long double, since there's no C89 or C99
requirement stating that double has to be 64 bits.

> Some older systems tended to generate an INEXACT FP exception in such
> cases, since you lose precision: a 64-bit IEEE double cannot store 19
> significant digits.

Yes, but we shouldn't need to worry about inexact exceptions, as they
occur all the time in practical gawk executions.  If they break
things, then a good chunk of the numeric computation in gawk is
already broken.




reply via email to

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