Search Postgresql Archives

Re: Float8 precision problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



And (indeed) that is exactly the answer that you received [within
DLB_DIG units of precision].

I guess that you will be happier with NUMERIC(precision, scale) because
the results of operations will be closer to what you expect.

Suggested reading:
http://www.physics.ohio-state.edu/~dws/grouplinks/floating_point_math.pd
f

________________________________________
From: pgsql-general-owner@xxxxxxxxxxxxxx
[mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Hengki
Suhartoyo
Sent: Thursday, November 30, 2006 2:56 AM
To: pgsql-general@xxxxxxxxxxxxxx
Subject: [GENERAL] Float8 precision problem

Hi all,

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 

Help me please....

________________________________________
Want to start your own business? Learn how on Yahoo! Small Business.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux