Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Floating Point Arithmetic Message-ID: <14366@smoke.brl.mil> Date: 7 Nov 90 09:08:43 GMT References: <27095.9010261638@olympus.cs.hull.ac.uk> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 17 In article <27095.9010261638@olympus.cs.hull.ac.uk> rst@cs.hull.ac.uk (Rob Turner) writes: > (Henry Spencer) writes: > >In general, you should use 'double' for all floating point arithmetic >I agree with this, although it took me a fair while to get over the >natural hurdle of always prefering to use float because float >arithmetic 'must be faster' than double. Interestingly, that is not always true, especially using IEEE FP chips. >I believe that the situation has changed with ANSI C, and >none of these conversions are performed. Conversion to double is not REQUIRED but it is PERMITTED. The real reason for avoiding floats is that unless you already know all about this stuff, your computations may produce garbage due to the lack of precision attained using single precision.