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: Wed, 28 Dec 2005 10:37:16 -0500
User-agent: Mutt/1.4.1i

Oops, the last patch used the isfinite() function, but that should
probably be avoided, since it doesn't seem to be present on some
platforms (e.g. it's not in Solaris 8).  Revised patch attached.

$ ./gawk --lint 'BEGIN {x = log(0); printf "x = %s %g %d %x\n",x,x,x,x}'
gawk: warning: [s]printf: value -inf is out of range for `%d' format
gawk: warning: [s]printf: value -inf is out of range for `%x' format
x = -inf -inf -inf -inf

$ ./gawk --lint 'BEGIN {x = sqrt(-1); printf "x = %s %g %d %x\n",x,x,x,x}'
gawk: warning: sqrt: called with negative argument -1
gawk: warning: [s]printf: value nan is out of range for `%d' format
gawk: warning: [s]printf: value nan is out of range for `%x' format
x = nan nan nan nan

I suspect we should add some test cases for these various formatting issues...

Regards,
Andy

Attachment: gawk315.patch
Description: Text document


reply via email to

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