Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: comp.lang.c Subject: Re: C and Floating Point Message-ID: <7918@utzoo.UUCP> Date: Thu, 16-Apr-87 11:40:31 EST Article-I.D.: utzoo.7918 Posted: Thu Apr 16 11:40:31 1987 Date-Received: Thu, 16-Apr-87 11:40:31 EST References: <15958@sun.uucp> Organization: U of Toronto Zoology Lines: 28 Keywords: C Fortran Floating Point Parenthases > The standards committee has as one of it's obligations to define rules > that will allow writing code which will work on the largest number of > compilers as possible with little or no change. Allowing the compiler > to, at it's option, totaly ignore the EXPLICIT wishes of the programmer > is one of the easiest ways I can think of to produce a "standard" which > unnecessarily frustrates programmers, will actualy _Cause_ portability > problems, and is, in fact not a functional "Standard" at all. If you re-read paragraph 2 on page 185 of K&R, you will find that C has always been this way. C programmers who expect anything different do not understand the language they are programming in, which is a guaranteed way to become frustrated and cause portability problems. X3J11 has always given high priority to preserving the functioning of existing legitimate C programs; programs which depend on order of evaluation do not come under this heading, since C has always allowed rearrangement. Some languages do interpret parentheses as an expression of the programmer's wish to force order of evaluation. Some do not. C does not. The problem is not that the compiler is ignoring the programmer's wishes, but that the programmer does not understand how to express his wishes in C (as opposed to Fortran). I assure you that when you understand the language, it is not difficult to write code that will work on the largest number of computers possible with little or no change. -- "We must choose: the stars or Henry Spencer @ U of Toronto Zoology the dust. Which shall it be?" {allegra,ihnp4,decvax,pyramid}!utzoo!henry