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, 3 Jan 2006 11:59:34 -0500
User-agent: Mutt/1.4.1i

On Wed, Dec 28, 2005 at 03:00:56PM -0500, Andrew J. Schorr wrote:
> It seems that if (2*x == x) catches Inf or -Inf.  So one could perhaps
> say:
> 
>   case 'd':
>     ...
>     if ((tmpval != tmpval) || (2*tmpval == tmpval))
>       goto out_of_range;

Happy New Year!  And just in case anybody still cares, this last
test was invalid, since it mistakenly catches zero.  This test
looks as if it may work (catching only NaN and Inf);

   if ((tmpval != tmpval) || ((2*tmpval == tmpval) && (tmpval != 0)))
      goto out_of_range;

An updated patch is attached, in case anybody is interested. :-)

Regards,
Andy

Attachment: gawk315.patch
Description: Text document


reply via email to

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