bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Overflow to Infinity


From: arnold
Subject: Re: [bug-gawk] Overflow to Infinity
Date: Mon, 16 Jul 2018 00:51:06 -0600
User-agent: Heirloom mailx 12.4 7/29/08

Hi Eli.

> > Except for !=, where the result is true when one side is a NaN.
>
> If we allow one deviation, why not allow more?  How about NaN == NaN?

I wasn't clear. In hardware, all comparisons against NaN return
false, except for != which returns true. (Even for NaN != NaN, which
is weird.)

> I think this tendency of having Gawk behave like the underlying C is a
> bad idea.  But I already said similar things in the past and got voted
> down.  So I think I will stop arguing here.

The problem isn't just that gawk differs from C. It's that gawk currently
gives very strange results, period.  This is easy to demonstrate.

Compile the attached gen-float-table.c program and save its output
to hw-out.txt.  Run the attached gen-table.awk program with the
latest *released* gawk, and save its output to gawk-out.txt.

Compare the two .txt files side by side in a diff viewer, such as
meld on Linux.  Not only is gawk's output different from C's but it
is also nonsensical in several cases.  This is a direct consequence
of using the array index ordering routine for scalar comparisons.

Making gawk's output like C's will give us something that is approximately
sane.

And, as you say, we've beaten this to death now.

Thanks,

Arnold

Attachment: gen-float-table.c
Description: Binary data

Attachment: gen-table.awk
Description: Text document


reply via email to

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