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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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 Received: by 10.68.46.193 with SMTP id x1mr33446553pbm.7.1317476716123; Sat, 01 Oct 2011 06:45:16 -0700 (PDT) Path: lh7ni9084pbb.0!nntp.google.com!news1.google.com!postnews.google.com!k6g2000yql.googlegroups.com!not-for-mail From: "RasikaSrinivasan@gmail.com" Newsgroups: comp.lang.ada Subject: Re: fixed point vs floating point Date: Sat, 1 Oct 2011 06:37:25 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <440acd0c-f6ca-4c24-a8ae-3c5dbf71467c@dm9g2000vbb.googlegroups.com> <82lit6z64n.fsf@stephe-leake.org> NNTP-Posting-Host: 71.175.94.19 Mime-Version: 1.0 X-Trace: posting.google.com 1317476715 26028 127.0.0.1 (1 Oct 2011 13:45:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 1 Oct 2011 13:45:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k6g2000yql.googlegroups.com; posting-host=71.175.94.19; posting-account=mZyFSQoAAABfOmklsh1d8TPbS2LncUKl User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUARLECNK X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/534.48.3 (KHTML, like Gecko) Version/5.1 Safari/534.48.3,gzip(gfe) Xref: news1.google.com comp.lang.ada:18262 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2011-10-01T06:37:25-07:00 List-Id: in embedded platforms, it is not often we have a floating point processor (or it may come at a price which we cannot afford!) and they have to be emulated. fixed point arithmetic may do the job in certain class of problems. in my class of problems, i am not sure the fixed point arithmetic will be sufficient. the experiments are to understand how the fixed point solutions may diverge from the floating point solutions. but the basic answer appears to be that the ada generics makes it a tiny bit harder to do this - but unfortunately renders ADa.Numerics.* also not a viable option for fixed point data types. thanks for the insights, srini On Sep 30, 6:17=A0am, Stephen Leake wrote: > "RasikaSriniva...@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