[Top][All Lists]
[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: |
Wed, 28 Dec 2005 15:00:56 -0500 |
User-agent: |
Mutt/1.4.1i |
On Wed, Dec 28, 2005 at 02:30:07PM -0500, Andrew J. Schorr wrote:
> On Wed, Dec 28, 2005 at 09:09:21PM +0200, Eli Zaretskii wrote:
> > Try
> >
> > if (x != x)
> > {
> > /* this is not a finite number */
> > }
> >
> > (You need to make sure the compiler doesn't optimize away this
> > condition.)
>
> In my testing, that works fine for NaN, but it does not catch Inf.
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;
Regards,
Andy
- Re: gawk number to string bug, (continued)
Re: gawk number to string bug, Aharon Robbins, 2005/12/24
- Re: gawk number to string bug, Andrew J. Schorr, 2005/12/26
- Re: gawk number to string bug, Paul Eggert, 2005/12/26
- Re: gawk number to string bug, Andrew J. Schorr, 2005/12/26
- Re: gawk number to string bug, Andrew J. Schorr, 2005/12/27
- Re: gawk number to string bug, Andrew J. Schorr, 2005/12/28
- Re: gawk number to string bug, Andrew J. Schorr, 2005/12/28
- Re: gawk number to string bug, Eli Zaretskii, 2005/12/28
- Re: gawk number to string bug, Andrew J. Schorr, 2005/12/28
- Re: gawk number to string bug,
Andrew J. Schorr <=