Re: Float8 precision problem - Mailing list pgsql-general

From Michael Glaesemann
Subject Re: Float8 precision problem
Date
Msg-id E17FC53D-6BC7-4EC7-B7B1-15E467B7DDA9@seespotcode.net
Whole thread Raw
In response to Float8 precision problem  (Hengki Suhartoyo <hengman03@yahoo.com>)
List pgsql-general
On Nov 30, 2006, at 19:56 , Hengki Suhartoyo wrote:

> I got problem in postgrsql 8.0 when subtraction in float8, this is
> my query :
> select 6.1::float8-6::float8
>
> Result>>> 0.099999999999996
>
> I need the result like natural subtraction is 0.1

Then use numeric instead of float. Float by its very nature is not
precise.

Michael Glaesemann
grzm seespotcode net



pgsql-general by date:

Previous
From: Teodor Sigaev
Date:
Subject: Re: postgresql 8.2 rc1 - crash
Next
From: Ashish Karalkar
Date:
Subject: Erorr in running create set command