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.1 required=5.0 tests=BAYES_05,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!npeer01.iad.highwinds-media.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!peer01.am1!peering.am1!npeersf03.am4!fx01.fr7.POSTED!not-for-mail Message-ID: From: Mike H Reply-To: Mike Hopkins Newsgroups: comp.lang.ada Subject: Re: A curiosity about decimal fixed point types... References: <7d4f2e0c-0aed-4ba3-aa5a-0c2bc0c2c5a0@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8;format=flowed Content-Transfer-Encoding: 8bit User-Agent: Turnpike/6.07-M (<8c+$+zb077Pti5diXa8NqJs7Yt>) NNTP-Posting-Host: 83.104.138.185 X-Complaints-To: abuse@demon.net X-Trace: 1384189645 83.104.138.185 (Mon, 11 Nov 2013 17:07:25 UTC) NNTP-Posting-Date: Mon, 11 Nov 2013 17:07:25 UTC Date: Mon, 11 Nov 2013 17:06:31 +0000 X-Received-Body-CRC: 2863684100 X-Received-Bytes: 2234 Xref: news.eternal-september.org comp.lang.ada:17616 Date: 2013-11-11T17:06:31+00:00 List-Id: In message <7d4f2e0c-0aed-4ba3-aa5a-0c2bc0c2c5a0@googlegroups.com>, mockturtle writes >Dear all, >just a silly curiosity about decimal fixed point types, e.g., > > type Euro is delta 0.01 digits 20; > -- Would be 20 enough? :-) > >Are they currently used? Where? Since most of the examples are about >money (mine and RM's) included, I guess that they were thought for >financial applications, but I am unsure if nowadays financial software >uses this type of types or just floating point. Having worked in financial areas before moving into Ada, I would suggest that accumulations of rounding errors are a potential mine field for the honest and a potential gold mine for the dishonest! In consequence rigorous algorithm specification is far more important than most people would expect. Perhaps the ideal is to work in integers (exact figures of the lowest denomination of the coinage - pence, cents or w.h.y). But of course, too often this is not possible (e.g. currency conversions and discount rates) and that is when the problems really start. -- Mike "Homo sum, humani nihil a me alienum puto" = "I am human, (so) I (should) judge nothing of humanity to be strange." Publius Terentius (195/185–159 BC)