Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!seismo!mcvax!lambert From: lambert@mcvax.UUCP Newsgroups: comp.lang.c Subject: Re: C and Floating Point Message-ID: <7350@boring.mcvax.cwi.nl> Date: Wed, 15-Apr-87 17:27:34 EST Article-I.D.: boring.7350 Posted: Wed Apr 15 17:27:34 1987 Date-Received: Fri, 17-Apr-87 06:17:36 EST References: <15958@sun.uucp> <5716@brl-smoke.ARPA> Reply-To: lambert@boring.UUCP (Lambert Meertens) Organization: CWI, Amsterdam Lines: 31 Keywords: C Fortran Floating Point Parenthases >> For example, (foo / h_bar) / h_bar works, but the faster and >> mathematically equivalent expression foo / (h_bar * h_bar) does not work. > > So you should have measured "foo" in units of h_bar ... Measures indicating h_bar units are hard to come by*. Of course you want to do the computations in such units, but then you have to convert the measurements first. ________ *I believe they keep a platinum h_bar in the Paris Bureau de Poids et des Mesures, but I understand they are loath to lend it out. Can we stop this discussion now? (Summary: From the point of view of people who want to do serious numerical work it was a mistake that fp operations were handled as if they were true to the algebraic properties of their mathematical abstractions, which is good enough for most of the people all of the time, and for all of the people (numerical analysts are not people) most of the time, but not ... . But don't forget that C was really designed for systems programming and such. There was already a work-around by using assignments to temporaries, which was really hard on the people who wanted to control the exact sequencing of the operations, and now there is this kludge that no-one is really happy with but that sure makes life easier for them. Proposals to change the C semantics for fp operations only still leave some other rearrangement problems unresolved and are probably not a good idea anyway. We'll have to live with it. As a consolation I can say that the situation has not gotten worse because of the unary + and that this is fortunately :-) not the worst problem with C anyway, far from it.) -- Lambert Meertens, CWI, Amsterdam; lambert@cwi.nl