Re: somebody could explain this? - Mailing list pgsql-hackers

From Otto Hirr
Subject Re: somebody could explain this?
Date
Msg-id 60E3D96224DB4AE2BDB12F95655A4786@olabinc.com
Whole thread Raw
In response to Re: somebody could explain this?  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: somebody could explain this?  (Greg Stark <gsstark@mit.edu>)
List 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.



pgsql-hackers by date:

Previous
From: "Dann Corbit"
Date:
Subject: Re: [PERFORM] insert performance for win32
Next
From: Gregory Maxwell
Date:
Subject: Re: Reducing the overhead of NUMERIC data