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-Thread: 103376,bc1441bb4023e50f X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 21 Jul 2008 00:11:27 -0500 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Financial Calculations in Ada References: X-Newsreader: Tom's custom newsreader Message-ID: Date: Mon, 21 Jul 2008 00:11:27 -0500 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 71.202.183.17 X-Trace: sv3-vNqi10GSWcHM7EgV4L3s3wSFLz+IJv+qRENBBuaMD+jfcMw8crIe6Pvo3cQV89+K1JmRuRAjzsuou9W!AdsYGkpE3ja4O8G14MgDLOr0cVseLj7rAOQSYiSqP0chWskquRgiFqg6B88T58VqKFHFzaWH6F1h!aUj1MDkbzXqauiCDVV6HAmF8jIj0Fw== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.39 Xref: g2news1.google.com comp.lang.ada:1232 Date: 2008-07-21T00:11:27-05:00 List-Id: >An interest rate isn't an amount of money, so don't use type Money to >represent it. "delta 0.01" is good for display. It also works if you only add, subtract, and multiply by integers. Once your arithmetic goes beyond that, precision and rounding become a policy decision. For instance, at a rate of 7.125% is the total interest, rounded to pennies, on three $50 loans .07125*50 = 3.5625, 3.56 * 3 = $10.68 Or is it 3*3.5625 = 10.6875, rounded to $10.69?