BUG #4603: float4 error

Started by Stefan Hoffmannover 17 years ago2 messagesbugs
Jump to latest
#1Stefan Hoffmann
hoffst@maxinf.de

The following bug has been logged online:

Bug reference: 4603
Logged by: Stefan Hoffmann
Email address: hoffst@maxinf.de
PostgreSQL version: 7.4
Operating system: ubuntu linux server
Description: float4 error
Details:

some specific values such as 20048223 or -25771373 can't be stored in float4
. they are replaced by 20048224 and
-25771372 when inserted or updated in float4 .
is this a problem of 7.4 or caused by "inexact" float4 ?

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stefan Hoffmann (#1)
Re: BUG #4603: float4 error

"Stefan Hoffmann" <hoffst@maxinf.de> writes:

some specific values such as 20048223 or -25771373 can't be stored in float4
. they are replaced by 20048224 and
-25771372 when inserted or updated in float4 .
is this a problem of 7.4 or caused by "inexact" float4 ?

The latter. On most machines float4 is only good for about six
significant digits, and you're expecting eight ...

regards, tom lane