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-17 06:36:31 PST Message-ID: <3D357168.6050303@cogeco.ca> From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Floating Decimal Package/Library? References: <3D345DB3.5080609@cogeco.ca> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 17 Jul 2002 09:30:16 -0400 NNTP-Posting-Host: 198.96.47.195 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1026912616 198.96.47.195 (Wed, 17 Jul 2002 09:30:16 EDT) NNTP-Posting-Date: Wed, 17 Jul 2002 09:30:16 EDT Organization: Bell Sympatico Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!snoopy.risq.qc.ca!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Xref: archiver1.google.com comp.lang.ada:27187 Date: 2002-07-17T09:30:16-04:00 List-Id: tmoran@acm.org wrote: >>Finally, I should mention that I am using GNAT. Unless I >>am mistaken, it seemed that the decimal support wasn't >>exactly decimal (I'd have to go back and recheck, but I >>got the impression that it is implemented in binary >>floating point). If it truly is implemented in decimal, >> > You got the wrong impression. Decimal is implemented as > decimal, not binary. > type Change_In_My_Pocket is delta 0.01 digits 3; > allows values up to $9.99 with one penny precision. > type Gates_Tax_Calculations is delta 1.0 digits 11; > allows values up to $99 billion with rounding to whole dollars. OK, I checked this out last night, and I was wrong about GNAT's implementation. Part of me wanted to wait before I stuck my foot in my mouth.. I now withdraw it. ;-) >>Systems that are written to use binary floats for accounting >>purposes, always leave the programmer with >>the joy all of those "off by one penny" errors. >> > Are you aware of the Information Systems Annex? It's there > to make decimal accounting programming easy. GNAT's limitation of 18 digits however, still make some problems difficult to solve. Imagine 4 to 6 decimal positions, leaving 12 digits to represent figures in Turkish Liras. It doesn't leave much head room for further devaluation. Warren.