[Tutor] How to correct decimal addition.

spir denis.spir at gmail.com
Sun Jan 26 01:19:58 CET 2014


On 01/25/2014 10:19 PM, Keith Winston wrote:
> On Sat, Jan 25, 2014 at 3:57 AM, spir <denis.spir at gmail.com> wrote:
>> Note: AFAIK most financial software use integers for this reason and to
>> avoid (or control) rounding errors.
>
> I don't think this is true (no flame intended, hopefully you know I'm
> forever in your debt Denis): there's a famous scam where insiders at a
> major financial institution set the software so it always rounds down,
> and the difference was deposited in their account. It was a matter of
> fractions of pennies on a per-scam basis. I'm not certain if this ever
> actually happened (I thought it did, but Snopes seems agnostic).
>
> http://www.snopes.com/business/bank/salami.asp

There's a similar story in France as well, but it was several decades ago. 
Incendentally, I used to know several people involved in financial software 
companies; they did use integers for all computations. Maybe today they use 
decimals, dunno (since then, decimal libs have become far more famous and used).

d


More information about the Tutor mailing list