Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!sco!seanf From: seanf@sco.COM (Sean Fagan) Newsgroups: comp.lang.c Subject: Re: Floating Point Arithmetic Message-ID: <8780@scolex.sco.COM> Date: 15 Nov 90 23:28:28 GMT References: <27095.9010261638@olympus.cs.hull.ac.uk> <14366@smoke.brl.mil> Sender: news@sco.COM Organization: The Santa Cruz Operation, Inc. Lines: 22 In article <14366@smoke.brl.mil> gwyn@smoke.brl.mil (Doug Gwyn) writes: >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. One of the more amusing tests I've run was on an AT&T 3B5, with no FPU (it did, however, have an FP emulator). Anyway, code using 'float' was *much* slower than code using 'double', because all 'float' variables had to be promoted to 'double', and that was *also* emulated, and took quite a bit of time (not to mention demoting them back down to 'float'). -- -----------------+ Sean Eric Fagan | "*Never* knock on Death's door: ring the bell and seanf@sco.COM | run away! Death hates that!" uunet!sco!seanf | -- Dr. Mike Stratford (Matt Frewer, "Doctor, Doctor") (408) 458-1422 | Any opinions expressed are my own, not my employers'.