in reply to Re^5: Why is the execution order of subexpressions undefined? (sane?)
in thread Why is the execution order of subexpressions undefined?
So does that mean $z is calculated before $y+1 or not? In what order does $w get calculated?
$w= $z; $x= ( $a + $w ) * ( $y + 1 ) + ( $a + $z ) / ( $y + 1 );
The optimizer notices that $w and $z must be equal and so we need only add $a to their shared value once. In what order does this single operation happen relative to the rest of the calculations? If I change the first assignment, surely the order of operations for the second assignment doesn't change. What is the obvious answer to this?
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Why is the execution order of subexpressions undefined? (sane?)
by BrowserUk (Patriarch) on Apr 12, 2005 at 06:44 UTC | |
by theorbtwo (Prior) on Apr 18, 2005 at 12:33 UTC |