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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7cda96e9413b780c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-19 07:41:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!newsfeed00.sul.t-online.de!t-online.de!news-lei1.dfn.de!news-fra1.dfn.de!news.man.poznan.pl!pwr.wroc.pl!panorama.wcss.wroc.pl!hebisch From: hebisch@math.uni.wroc.pl (Waldek Hebisch) Newsgroups: comp.lang.ada Subject: Re: Floating Decimal Package/Library? Date: 19 Jul 2002 14:41:04 GMT Organization: Politechnika Wroclawska Message-ID: References: NNTP-Posting-Host: hera.math.uni.wroc.pl X-Trace: panorama.wcss.wroc.pl 1027089664 23467 156.17.86.1 (19 Jul 2002 14:41:04 GMT) X-Complaints-To: abuse@news.pwr.wroc.pl NNTP-Posting-Date: 19 Jul 2002 14:41:04 GMT X-Newsreader: TIN [version 1.2 PL2] Xref: archiver1.google.com comp.lang.ada:27250 Date: 2002-07-19T14:41:04+00:00 List-Id: Robert C. Leif (rleif@rleif.com) wrote: : From: Bob Leif : To: Waldek Hebisch et al. : The point is NOT speed but is accuracy and understandability. Our : arithmetic education is based on decimals. Fixed point types including : decimal types have the problem of not being able to create a type with : an exponent (delta) value calculated at run-time. Either a user formula : or a default to the equivalent of floating point could be used for : calculating the value of the exponent. This probably is a pain for the : compiler writers. However, one of the virtues of Ada is that the : compiler writers work to ease the developers' work. A simple example of : the use of a floating decimal type is spreadsheets, which should be : based on type decimal. My second claim was that using GMP one can make reasonable implementation of fixed point arithmetic, it looks that you agree. My first claim was that floating point is NOT easy to understand (in your sense): its round-off error is very hard to control. Especialy in finacial applications decimal floating point have most of disadvantages of binary arithmetic, with added trap that on "small" numbers all looks ok, and errors kick in only when you have many decimal digits. So I think that binary floating point is easier to understand thentrue decimal floating point, with binary you get burned early and learn that it is inaccurate, with decimal you discover errors much later. And for example IBM PL/1 implemnts decimal floating point just as binary (hexadecimal), while for fixed point uses special decimal hardware instructions. In other words, either you give up precise control over rounding and use floating point, or you specify your rounding policy and use fixed point. This does not exlude posibility to specify precision at run-time, you just must prescribe how much precision you need. -- Waldek Hebisch hebisch@math.uni.wroc.pl or hebisch@hera.math.uni.wroc.pl