Xref: utzoo comp.lang.c:12532 comp.lang.fortran:1082 Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!tut.cis.ohio-state.edu!rutgers!cmcl2!phri!marob!samperi From: samperi@marob.MASA.COM (Dominick Samperi) Newsgroups: comp.lang.c,comp.lang.fortran Subject: C associativity rules Keywords: associativity, expressions Message-ID: <412@marob.MASA.COM> Date: 13 Sep 88 01:22:14 GMT Organization: ESCC New York City Lines: 14 Does K&R C or the new ANSI C permit the compiler to evaluate an expression like a+b+c in any order it pleases, rather than in the strict left-to-right order (a+b)+c ? I've always assumed that a strict left-to-right order would be used, as is the case for relational expressions like the one in the following. while(i != -1 && a[i] != k) whatever ; Apparently FORTRAN permits the compiler to evaluate the expression in any order it pleases, for optimization purposes. -- Dominick Samperi, NYC samperi@acf8.NYU.EDU samperi@marob.MASA.COM cmcl2!phri!marob uunet!hombre!samperi (^ ell)