Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ttrdc.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!mgnetp!ltuxa!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: net.lang.c Subject: Re: C Floating point arithmetic Message-ID: <608@ttrdc.UUCP> Date: Wed, 27-Nov-85 20:24:28 EST Article-I.D.: ttrdc.608 Posted: Wed Nov 27 20:24:28 1985 Date-Received: Fri, 29-Nov-85 00:03:06 EST References: <706@lasspvax.UUCP> <4614@alice.UUCP> <793@umd5.UUCP> <42@brl-tgr.ARPA> Organization: AT&T, Computer Systems Division, Skokie, IL Lines: 34 In article <42@brl-tgr.ARPA>, gwyn@brl-tgr.ARPA (Doug Gwyn ) writes: >> >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... > >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. Sounds a bit pejorative. If for example I were to attempt to speed up crun- ching in, say, a Fortran program by using real [float] instead of double precision [double] I might well want to include both versions of a critical routine in the code, and every so many steps run the double as well as the single, or otherwise check the sanity of the results. I am not a numerical analysis guru, but I surmise there might be testable conditions whereby it could be determined (without an overly large computational penalty) whether a computation could be entrusted to single precision or whether double precision should be used, prior to actually performing the computation. Any crunch gurus out there care to comment? -- ------------------------------- Disclaimer: The views contained herein are | dan levy | yvel nad | my own and are not at all those of my em- | an engihacker @ | ployer or the administrator of any computer | at&t computer systems division | upon which I may hack. | skokie, illinois | -------------------------------- Path: ..!ihnp4!ttrdc!levy