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: Andrew J. Schorr
Subject: Re: gawk number to string bug
Date: Tue, 20 Dec 2005 09:39:35 -0500
User-agent: Mutt/1.4.1i

On Tue, Dec 20, 2005 at 09:06:32AM -0500, Andrew J. Schorr wrote:
>    32-bit x86:
>       tmpval = 18446744073709551616, UINTMAX_MAX = 4294967295, 
> (double)UINTMAX_MAX = 18446744073709551616, (tmpval <= UINTMAX_MAX) = 1
>       uval = 0
>    64-bit x86 (opteron):
>       tmpval = 18446744073709551616, UINTMAX_MAX = 18446744073709551615, 
> (double)UINTMAX_MAX = 18446744073709551616, (tmpval <= UINTMAX_MAX) = 1
>       uval = 0

Actually, on both of those platforms, UINTMAX_MAX is defined
as 18446744073709551615ULL, so the 32-bit printf is misleading (because
I was converting it down to 32 bits from 64 bits).  But that doesn't
affect the real problem here: (tmpval <= UINTMAX_MAX) is giving the
wrong result.

Regards,
Andy




reply via email to

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