|
From: | Teri Price |
Subject: | [bug-gawk] Documentation |
Date: | Tue, 9 Dec 2014 14:35:28 -0500 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |