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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cc6a4bc415a41111 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.11.199 with SMTP id s7mr45154498pbb.5.1317377850540; Fri, 30 Sep 2011 03:17:30 -0700 (PDT) Path: lh7ni8204pbb.0!nntp.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: fixed point vs floating point References: <440acd0c-f6ca-4c24-a8ae-3c5dbf71467c@dm9g2000vbb.googlegroups.com> Date: Fri, 30 Sep 2011 06:17:28 -0400 Message-ID: <82lit6z64n.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (windows-nt) Cancel-Lock: sha1:/bqSZp+BNFyHa0x5CRIc/lPyVXE= MIME-Version: 1.0 X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 56a8c4e85973ae029e66101198 Xref: news1.google.com comp.lang.ada:18226 Content-Type: text/plain; charset=us-ascii Date: 2011-09-30T06:17:28-04:00 List-Id: "RasikaSrinivasan@gmail.com" writes: > friends > > I am investigating the applicability of fixed point to a numerical > problem. I would like to develop the algorithm as a generic and test > with different floating and fixed point types to decide which one to > go with. What sort of criteria are you using to make the decision? If it's just speed, then the answer will depend more on the hardware and the level of compiler optimization than on this choice. The major algorithmic difference between fixed and floating is the handling of small differences; floating point allows arbitrarily small differences (down to the exponent limit, of course), while fixed point has a fixed small difference. So the choice should be determined by the application, not by experiment. The only place I have found fixed point to be useful is for time; everything else ends up needing to be scaled, so it might as well be floating point from the beginning. The other thing that can determine the choice is the hardware; if you have no floating point hardware, you will most likely need fixed point. But even then, it depends on your speed requirement. You can do floating point in software; it's just slower than fixed point on the same hardware. > - can we design a generic (function or procedure) that can accept > either fixed point or floating point data types at the same time > excluding other types No. -- -- Stephe