Newsgroups: comp.sys.amiga.programmer Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-picayune.mit.edu!athena.mit.edu!amgreene From: amgreene@athena.mit.edu (Andrew Marc Greene) Subject: Re: Compiler code (was a flame fest) Message-ID: <1991Apr18.122054.13695@athena.mit.edu> Sender: news@athena.mit.edu (News system) Organization: Plucky Duck Fan Club References: <1991Apr16.001748.26530@uncecs.edu> <1991Apr16.183638.12808@cs.cornell.edu> <1991Apr17.180342.25312@engin.umich.edu> Date: Thu, 18 Apr 91 12:20:54 GMT Lines: 26 In article <1991Apr17.180342.25312@engin.umich.edu> milamber@caen.engin.umich.edu (Daryl Cantrell) writes: > I don't think you take his meaning... If you have an expression like > > a * b + c * d > >C defines the order of operations with regard to the operators. That is, >the multiplications will be performed before the addition. However, there >is no way to know whether a * b or c * d will be evaluated first. Simi- >larly, it is not defined whether a or b will be evaluated first in the >multiplication. The only exceptions are the && and || operators, where >left operand can short circuit the right. > > Personally, I would find such a definition about as useful as computed >gotos... (Not at all) Oh, but it *is* useful! What is the value of the following code fragment? int n = 4; (++n) * (--n); If the first operand to * is treated first, the answer is 20. If the second operand to * is treated first, the answer is 12. -- Andrew | .sigs are for people with bandwidth to burn