Precision problems with float8
| От | Gabriel Fernandez |
|---|---|
| Тема | Precision problems with float8 |
| Дата | |
| Msg-id | 3BEBFA27.154467F3@unica.edu обсуждение исходный текст |
| Ответы |
Re: Precision problems with float8
|
| Список | 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 :-)
В списке pgsql-general по дате отправления: