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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3c55100a141db64d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1993-03-22 22:46:27 PST Newsgroups: comp.lang.ada Path: sparky!uunet!noc.near.net!howland.reston.ans.net!agate!linus!linus.mitre.org!linus!mbunix!eachus From: eachus@dr_no.mitre.org (Robert I. Eachus) Subject: Re: Membership in "set" of characters In-Reply-To: dww@math.fu-berlin.de's message of Mon, 22 Mar 1993 12:22:49 GMT Message-ID: Sender: news@linus.mitre.org (News Service) Nntp-Posting-Host: dr-no.mitre.org Organization: The Mitre Corp., Bedford, MA. References: <1993Mar19.195712.9187@wdl.loral.com> <1ok4ts$3cv@huon.itd.adelaide.edu.au> Date: Mon, 22 Mar 1993 17:11:06 GMT Date: 1993-03-22T17:11:06+00:00 List-Id: Just to avoid giving fixed point a bad name... > Just using > type DM is delta 0.01 range 0.0 .. 1000.0; > gets me in trouble because the delta is a positive fraction > that causes rounding errors. I need > for DM'small use 0.01; > to make it work as I expect, but I've been advised to leave FIXED > alone until I understand more about Ada :-) The 'small clause may make things work the way that you expect (assuming your compiler supports it). In any case the ADAR packages should help. Fixed point arithmetic--independant of Ada--is hard, however if you know how to use it you can and will get much more accurate results than using floating point. Floating point can be easily used to give you an answer which is very close to correct, fixed point allows you to always get the exact right answer, but is much harder to use. The trick is that you must at every point be aware of the ACCURACY and PRECISION of the data--and be aware that they are two different things. When I am writing such code, I find myself doing several passes looking at each operation to be sure I know if and when any rounding, truncation or change in precision occurs. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...