Re: Precision problems with float8

From: Gabriel Fernandez <gabi(at)unica(dot)edu>
To: PostgreSQL-general <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: Precision problems with float8
Date: 2001-11-16 16:31:49
Message-ID: 3BF53F74.17720FEC@unica.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
test_set.d application/x-unknown-content-type-d_auto_file 1.7 KB

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2001-11-16 16:38:13 Re: index on numbers not honoured
Previous Message K. Ari Krupnikov 2001-11-16 16:08:04 table names