comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: Financial Calculations in Ada
Date: Mon, 21 Jul 2008 00:11:27 -0500
Date: 2008-07-21T00:11:27-05:00	[thread overview]
Message-ID: <Auidne7HsN7ihxnVnZ2dnUVZ_q7inZ2d@comcast.com> (raw)
In-Reply-To: lnwsjgkluz.fsf@nuthaus.mib.org

>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?



  reply	other threads:[~2008-07-21  5:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-20 23:27 Financial Calculations in Ada rd
2008-07-21  2:32 ` Keith Thompson
2008-07-21  5:11   ` tmoran [this message]
2008-07-21  4:46 ` Gautier
2008-07-21  8:24 ` Graham Stark
2008-07-21  8:30   ` Georg Bauhaus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox