Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!ima!mirror!xanth!kent From: kent@xanth.UUCP Newsgroups: comp.lang.c Subject: Re: Order of evaluation, machine floating point Message-ID: <739@xanth.UUCP> Date: Wed, 25-Mar-87 00:41:28 EST Article-I.D.: xanth.739 Posted: Wed Mar 25 00:41:28 1987 Date-Received: Thu, 26-Mar-87 06:20:09 EST References: <4775@brl-adm.ARPA> <7779@utzoo.UUCP> <521@cpocd2.UUCP> <2910@jade.BERKELEY.EDU> Reply-To: kent@xanth.UUCP (Kent Paul Dolan) Organization: Old Dominion University, Norfolk Va. Lines: 23 In article <2910@jade.BERKELEY.EDU> mwm@eris.BERKELEY.EDU (Mike (My watch has windows) Meyer) writes: >K&R's forcing things to double precision, as well as not having a >reasonable way (I know, use temporary variables; that's not >reasonable!) to force order of evaluation made it almost completely >unsuitable for doing number crunching. ANSI has fixed both of those >(or made it possible for compiler writers to fix them). Mike, Not a flame at you, but C was an ugly language to begin with, because so much of it doesn't parse the way it reads, due to _bizarre_ precedence results. Adding the unary plus, which, to anyone taught mathematics, is a no-op, and making that the way to control the order of evaluation, just makes an ugly language uglier. Code that needs to be _that_ fast should be done in assembly. ANSI should have mandated respecting parentheses for evaluation order, so that code executes the way it reads. This would break _no_ code, and would let programmers' intuition be of some use in writing code in C. I just can't be very sympathetic, in a time of ever increasing computer speeds and memory, to optimizing the code at the expense of the coder. The latter is the big expense item these days, and has been for over ten years now. Kent.