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: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: fixed point vs floating point Date: 1997/11/22 Message-ID: #1/1 X-Deja-AN: 291582039 Sender: news@inmet.camb.inmet.com (USENET news) References: Followup-To: comp.lang.ada,sci.math.num-analysis Distribution: inet X-Nntp-Posting-Host: houdini.camb.inmet.com Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada,sci.math.num-analysis Date: 1997-11-22T00:00:00+00:00 List-Id: Matthew Heaney (mheaney@ni.net) wrote: : Matthew asks: : <> : Robert replies: : <> I'm not sure to what Robert is referring here. Fixed + fixed is as efficient as the normal integer operation, as is Fixed - Fixed, Fixed * Integer, and Fixed / Integer. The only operations that are potentially inefficient are Fixed * Fixed and Fixed / Fixed, neither of which are particularly likely when the fixed-point type represents an angle ;-). Even if you do use Fixed * Fixed or Fixed / Fixed, the inefficiency has to do with sometimes having to shift the result or one of the operands after/before performing the operation (presuming binary smalls). If the machine has efficient shifting, this is not a major overhead. However, it may be that on some compilers, the fixed-fixed multiplication/division operations are handled out-of-line, and the procedure-call overhead is the primary added expense. : ... : Matthew Heaney : Software Development Consultant : : (818) 985-1271 -- -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Burlington, MA USA