[GENERAL] Float8 precision problem

2006-11-30 Thread Hengki Suhartoyo
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.096 I need the result like natural subtraction is 0.1 Help me please ___

Re: [GENERAL] Float8 precision problem

2006-11-30 Thread Dann Corbit
/floating_point_math.pd f From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hengki Suhartoyo Sent: Thursday, November 30, 2006 2:56 AM To: pgsql-general@postgresql.org Subject: [GENERAL] Float8 precision problem Hi all, I got problem in

Re: [GENERAL] Float8 precision problem

2006-11-30 Thread Michael Glaesemann
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.096 I need the result like natural subtraction is 0.1 Then use numeric instead of float. Float by its very

Re: [GENERAL] Float8 precision problem

2006-11-30 Thread Kaloyan Iliev
Hi, What about cast to numeric? select 6.1::numeric-6::numeric ; ?column? -- 0.1 (1 row) Regards, Kaloyan Iliev Hengki Suhartoyo wrote: 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.09