Re: BUG #1888: bug in cast from float4 to float8

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pablo Oses" <opablo(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1888: bug in cast from float4 to float8
Date: 2005-09-17 13:46:52
Message-ID: 7320.1126964812@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Pablo Oses" <opablo(at)gmail(dot)com> writes:
> select cast(123.456::float4 as float8)

> what do you think its the answer ? 123.456 ?

> well pgsql 7.2.2, 8.0.0, 8.0.1 and 8.0.3 (all i have used) answers this:
> 123.456001281738 which is WRONG

This is not a bug. Please go learn something about floating-point
arithmetic (or if you don't care to, use type numeric instead).

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Fuhr 2005-09-17 13:51:36 Re: BUG #1888: bug in cast from float4 to float8
Previous Message Pablo Oses 2005-09-17 03:00:50 BUG #1888: bug in cast from float4 to float8