Path: utzoo!utgpu!watserv1!watcgl!ksbooth From: ksbooth@watcgl.waterloo.edu (Kelly Booth) Newsgroups: comp.graphics Subject: Re: Integral Square Root Message-ID: <12807@watcgl.waterloo.edu> Date: 31 Dec 89 20:18:54 GMT References: <9170@cbmvax.commodore.com> <21550@mimsy.umd.edu> <9175@cbmvax.commodore.com> Reply-To: ksbooth@watcgl.waterloo.edu (Kelly Booth) Organization: U. of Waterloo, Ontario Lines: 21 In article <9175@cbmvax.commodore.com> mitchell@cbmvax.commodore.com (Fred Mitchell - PA) writes: >NOT WRONG- Let's analyze this line more closely (exploded IF, here we come!)... > > if ( > ( rb = r + > (b=1< * rb > <= n) > >Now the one stipulation of the C standard is that INNER PARENTHESIS >GETS EVALUATED FIRST!!!! People say this about Fortran. They are wrong. The rules on parentheses are intended to over-ride the default precedence rules of the language. They do no force a particular order of evaluation on the compiler as you assume. All the rules say is that the result of the inner parenthesized expression is to be treated as a single value within the larger expression. The relative order of evaluation of subexpressions can be anything the compiler wants as long as it is consistent with this (very mild) constraint. Most (if not all) of the problems that arise from side effects in functions are due to this problem (or variants of it).