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: Geert Bosch Subject: Re: fixed point vs floating point Date: 1997/11/23 Message-ID: <65846t$4vq$1@gonzo.sun3.iaf.nl>#1/1 X-Deja-AN: 291703311 References: Distribution: inet Organization: La Calandre Infortunee Newsgroups: comp.lang.ada,sci.math.num-analysis Date: 1997-11-23T00:00:00+00:00 List-Id: Matthew Heaney wrote: Anyway, I'll accept that fixed point operations are slower, but the question remains: Why do most programmers insist on using floating point when a fixed point better models the abstraction? Is the reason solely based on efficiency? By the way, are there off-the-shelf subprograms (in Ada preferably, but I'd take any language) for computing the elementary functions (sin, cos, etc) of a fixed point angle? Maybe your second questions answers the first. It is really useless to try hard to calculate a sinus using integer arithmetic when you have a perfectly fine and very fast, well tested floating-point unit in your computer that can calculate the sinus with a delta smaller than 0.000000000000001 probably. Converting a fixed point value to fpt, issue the sinus instruction and convert it back is much faster than even thinking about doing it in fixed point. ;-) Regards, Geert