Re: Precision problems with float8 - Mailing list pgsql-general

From Gabriel Fernandez
Subject Re: Precision problems with float8
Date
Msg-id 3BF53F74.17720FEC@unica.edu
Whole thread Raw
In response to Precision problems with float8  (Gabriel Fernandez <gabi@unica.edu>)
Responses Re: Precision problems with float8  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
Hi Stephan,

Here I send a short script to show the problem when using the float8 in
additions or substractions, etc.

Just execute it and look at the output. It just creates a table
('prova') which has the 'amount' column with values with only two
decimal places, but the sum(amount) has 10 decimal places.

Just look at the output of the script and you'll see:
In the set of data I send to you, you can see that the 10th decimal
appears just when we add the last amount. So when it calculates 84193.26
+ 4346.44 the result is 88539.7000000001, given that the 84193.26  is
the sum(amount) just before adding the last amount.

I hope this will be enough to show the problem.

Thanks,

Gabi :-)

Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Poor performance on SCSI machines, good on IDE?
Next
From: "K. Ari Krupnikov"
Date:
Subject: table names