Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!gatech!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.lang.c Subject: Re: C Floating point arithmetic Message-ID: <42@brl-tgr.ARPA> Date: Mon, 25-Nov-85 10:47:33 EST Article-I.D.: brl-tgr.42 Posted: Mon Nov 25 10:47:33 1985 Date-Received: Tue, 26-Nov-85 20:56:07 EST References: <706@lasspvax.UUCP> <4614@alice.UUCP> <793@umd5.UUCP> Organization: Ballistic Research Lab Lines: 35 > >No -- on most machines, single-precision does not offer enough significance > >for serious number-crunching, so people tend to use double-precision > >anyway if they care about the results. > > Now, this is a most disingenious argument. If this were really true, one > would map 'float' to the double-precision operations and totally ignore the > single-precision ones. > > Let's face it - this, as well as several other "features" of the Unix system > (such as the treatment of parameters passed to functions) is left over from > the PDP-11 days, and puts the lie to Unix's claim of machine independance... Both viewpoints have some merit. By the way, the discussion is about C, not about UNIX!! Certainly, some of C's harder-to- justify features, such as parameter widening, are the result of implementing the original version on a PDP-11. But these rules can be and are expressed in a machine-independent manner. Just because a language does not offer complete access to every quirk of every architecture does not mean that the language is machine-dependent! If C were to be redesigned, it would probably be wise to give EVERY basic data type equal citizenship. But it's too late now. Actually, X3J11 allows floats to be operated on without widening to doubles (except for parameter passing). Due to the unique characteristics of floating-point operations, this change is unlikely to break much existing correct code (unlike changes to integer data types). I agree that in most cases where the loss of speed might really matter, double precision is usually needed anyway to get meaningful results. Some people, though, judge code more on how fast it runs than on whether it performs a useful function correctly.