Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!amdcad!sun!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.lang.fortran Subject: Re: Fortran versus C for numerical analysis Message-ID: <344@quintus.UUCP> Date: 2 Sep 88 11:13:40 GMT References: <893@amelia.nas.nasa.gov> <3064@lanl.gov> <338@quintus.UUCP> <3534@s.cc.purdue.edu> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 19 In article <3534@s.cc.purdue.edu> ags@s.cc.purdue.edu.UUCP (Dave Seaman) writes: >In article <338@quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes: >[I said it badly, so I shan't quote it] >On the contrary, Fortran's parentheses control only grouping and have >nothing to do with evaluation order. Oops, sorry, expressed myself badly. When writing "evaluator order" I had in mind evaluate of _operators_, not of _operands_. What I meant was that there is no method of saying "this grouping is just syntactic so that I can read the expression, mathematical laws may be applied". The point is that some expressions can't be written without using parens, and there is no way of distinguishing those parens from ones that you *want* to have the special effect. For example, unless I am mistaken, (1.0+X)*2.0 must be evaluated that way rather than as 2.0+2.0*X. Sometimes you care, but sometimes you don't. In this particular example, unless you want to do part of the calculation yourself, you have to put the parens in to get around the operator priorities. If, however, I write 2*I+2, the compiler *is* free to rearrange this as 2*(I+1). Isn't it?