From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 107079,183ebe04e93f0506 X-Google-Attributes: gid107079,public X-Google-Thread: 103376,183ebe04e93f0506 X-Google-Attributes: gid103376,public From: hrubin@mean.stat.purdue.edu (Herman Rubin) Subject: Re: fixed point vs floating point Date: 1997/11/24 Message-ID: <65c58j$1302@mean.stat.purdue.edu>#1/1 X-Deja-AN: 292185289 Distribution: inet References: <65846t$4vq$1@gonzo.sun3.iaf.nl> Organization: Purdue University Statistics Department Newsgroups: comp.lang.ada,sci.math.num-analysis Date: 1997-11-24T00:00:00+00:00 List-Id: In article , Robert Dewar wrote: >Matthew says ><Robert reminded us, you have to know what you're doing when you use >floating point arithmetic. I was trying to avoid floating point types, >because I'm not a numerical analyst, and don't want to just *hope* my >floating point calculations produce a correct result. I want to *know* >they're correct. My error analysis is simpler if use a fixed point type, >right? >If my abstraction calls for a real type having an absolute error and not a >relative error, then clearly a fixed point type is called for, even if it's >less efficient, right? Isn't it always true that we should code for >correctness first, by using a type that directly models the abstraction, >and then optimize only if necessary? Are you making an exception to this >rule for fixed point types?>> In principle, there is no such thing as floating point arithmetic. Fixed point arithmetic can be done to arbitrary precision; to do floating arithmetic to much more than what is provided, it is necessary to emulating the floating in fixed, and to do the quite clumsy fixed point in floating. That fixed point arithmetic is so slow on computers is due to the fact that the hardware manufacturers, partly influenced by those gurus who do not see the uses of fixed point, have combined several fixed point instructions to produce floating point in such a way that it is very difficult to use it for anything else. It would not be difficult for the hardware to allow the fixed point part of the floating unit to be available to the user, and it would allow considerable speedup. -- This address is for information only. I do not claim that these views are those of the Statistics Department or of Purdue University. Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399 hrubin@stat.purdue.edu Phone: (765)494-6054 FAX: (765)494-0558