bug-gawk
[Top][All Lists]
Advanced

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

[bug-gawk] Documentation


From: Teri Price
Subject: [bug-gawk] Documentation
Date: Tue, 9 Dec 2014 14:35:28 -0500

In section 9.1.1 of the documentation, there is an example that I think has a mistake.
Here's the example:
"
i = 5
j = atan2(i++, i *= 2)

If the order of evaluation is left to right, then i first becomes 6, and then 12, and atan2() is called with the two arguments 6 and 12. But if the order of evaluation is right to left, i first becomes 10, then 11, and atan2() is called with the two arguments 11 and 10.

"

And here's what I think it should be:

If the order is left to right, atan2 is called with 2 arguments 5 and 12 because i++ has the value of 5 even though i became 6.

If the order is right to left, i*=2 makes i 10 and then i++ still holds the value 10, so the 2 arguments would be 10 and 10.

Sincerely,

Teri Price


reply via email to

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