Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!utcsri!flaps From: flaps@utcsri.UUCP Newsgroups: comp.lang.c Subject: Re: Optimizing Floating-Point Expression Evaluation Message-ID: <4616@utcsri.UUCP> Date: Sat, 18-Apr-87 17:43:39 EST Article-I.D.: utcsri.4616 Posted: Sat Apr 18 17:43:39 1987 Date-Received: Sun, 19-Apr-87 00:34:06 EST References: <16646@sun.uucp> Reply-To: flaps@utcsri.UUCP (Alan J Rosenthal) Organization: University of Toronto Lines: 27 Keywords: float point expression Summary: David Hough writes that if you say "(a + b) + c" you mean for the evaluation to be done in that order, and if you don't care you will say "a + b + c". That's fine, but please explain how you can know whether or not I care about evaluation order in the following: #define THING (a + 3.5) ... c = (THING + 1.1) * 2.6; How do I say that I want the 3.5 and 1.1 to be added at compile time? Assuming I say this by #defining THING as "a + 3.5" (which is bug-causing practice, by the way), the bigger question is how do I get you to multiply the 2.6 into the parentheses to compile as "c = (a*2.6) + 11.96"? -- Alan J Rosenthal flaps@csri.toronto.edu, {seismo!utai or utzoo}!utcsri!flaps, flaps@toronto on csnet, flaps at utorgpu on bitnet. "Probably the best operating system in the world is the [operating system] made for the PDP-11 by Bell Laboratories." - Ted Nelson, October 1977