Re: Precision loss casting float to numeric - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Precision loss casting float to numeric
Date
Msg-id CA+TgmoZvuXgnDAhEMcRJDGki=2pY9RdzxzW=5UxMTBMkZ_X2Yw@mail.gmail.com
Whole thread Raw
In response to Re: Precision loss casting float to numeric  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Feb 26, 2018 at 1:29 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> The bigger question here is whether people actually want this behavioral
> change.  I think there's probably a bigger chance of complaints that
> "casting 1.1::float8 to numeric now produces some weird,
> incorrectly-rounded result" than that we make anyone happier.

Yeah, I worry about that, too.

Of course, as you know, I also have a deep and abiding skepticism
about IEEE binary floats as a concept.  Anomalies are unavoidable; we
can choose exactly which set users experience, but we can eliminate
them because the underlying storage format is poorly-adapted to the
behavior people actually want.  It's too bad that IEEE decimal floats
weren't standardized until 2008.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: prokind column (was Re: [HACKERS] SQL procedures)
Next
From: Tom Lane
Date:
Subject: Re: prokind column (was Re: [HACKERS] SQL procedures)