Precision problems with float8

From: Gabriel Fernandez <gabi(at)unica(dot)edu>
To: PostgreSQL-general <pgsql-general(at)postgreSQL(dot)org>
Subject: Precision problems with float8
Date: 2001-11-09 15:45:43
Message-ID: 3BEBFA27.154467F3@unica.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I send a week ago a mail and I have not get any answer.

The main thing I want to know is: If I use the numeric type instead of
float8 will it result in a slower overall performance or it won't be
significantly different ?

As I posted I have some problems when I execute round(number,precision)
and use it in arithmetical operations: look at this:

compta=> select import from apunts where assent = 4 ;

import
---------
9.38

AND THEN:

compta=> select import - round(import,2)::float8 as substraction from
apunts where assent = 4 ;

substraction
---------------------------
-1.77635683940025e-15

(Of course, the initial 9.38 is the result of a previous calculation,
rounded with two decimals places, but the only thing you can see in the
value of the field is "9.38" ).

Does anyone know the reason ?

Thanks for your attention,

Gabi :-)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Reyes 2001-11-09 15:53:06 Re: Disable Transaction - plans ?
Previous Message Gurudutt 2001-11-09 15:07:35 Re: problem connecting client to a postgresSQL server