Newsgroups: comp.sys.amiga.programmer
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!maize.engin.umich.edu!milamber
From: milamber@caen.engin.umich.edu (Daryl Cantrell)
Subject: Re: Compiler code (was a flame fest) (now a lesser flame fest)
Message-ID: <1991Apr23.020319.7216@engin.umich.edu>
Sender: news@engin.umich.edu (CAEN Netnews)
Organization: University of Michigan Engineering, Ann Arbor
References: <1991Apr18.212939.3461@kessner.denver.co.us> <1991Apr19.032052.26387@engin.umich.edu> <91112.093750GHGAQZ4@cc1.kuleuven.ac.be>
Date: Tue, 23 Apr 1991 02:03:19 GMT

In article <91112.093750GHGAQZ4@cc1.kuleuven.ac.be> GHGAQZ4@cc1.kuleuven.ac.be writes:
>>  Nope.  ++ and -- are unary operators of the highest precedence.  The only
>>difference between ++x and x++ is the value they assume, the order of eval-
>>uation follows standard C precedence..
>
>I think you are wrong. Look at the following results :
>I have tried this with our mainframe compiler :
>   int n=4;
>
>   (n--)*(n++)   ->   12
>   (n++)*(n--)   ->   20
>   (--n)*(++n)   ->   16
>   (++n)*(--n)   ->   16
>   (--n)*(n++)   ->   12
>   (++n)*(n--)   ->   20
>   (n--)*(++n)   ->   16
>   (n++)*(--n)   ->   16
>
>          Jorrit Tyberghein

  You missed my point.  I was saying that ++ and -- are unary operators which
will be evaluated before the multiplication.  You've pointed out the argument
this stems from, which is that there's no way to know which side of the mult-
iplication is evaluated (You're compiler does the left first..).


--
+---------------------------------------+----------------------------+
|   // Daryl S. Cantrell                |   These opinions are       |
| |\\\ milamber@caen.engin.umich.edu    |    shared by all of    //  |
| |//  Evolution's over.  We won.       |        Humanity.     \X/   |
+---------------------------------------+----------------------------+
