Re: somebody could explain this?

From: "Otto Hirr" <otto(dot)hirr(at)olabinc(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: somebody could explain this?
Date: 2005-11-04 17:25:31
Message-ID: 60E3D96224DB4AE2BDB12F95655A4786@olabinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> What's happening here is that the multiplication, being
> floating point,
> has some accumulated error such that when you multiply it by 100 and
> convert it to an int, it hits the cutoff.

Trivia...
I heard a story many years ago that landed a programmer in prison...
He worked on the program that calculated interest that was to be
deposited into an account. Instead of rounding or truncating the
amount beyond what the bank wanted to use, he saved the small fractional
dollars (really micro-pennies) into an account. Soon he had several
hundred thousand in the account - there is a lot of multiplication...
He got caught.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Csaba Nagy 2005-11-04 17:30:56 Re: [OT] somebody could explain this?
Previous Message Chris Browne 2005-11-04 17:19:31 Re: PG 8.1 supported platforms list