Re: BUG #14138: Inconsistent rounding behavior in float4 coercion

From: Charles <cooper(dot)charles(dot)m(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Charles <cooper(dot)charles(dot)m(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14138: Inconsistent rounding behavior in float4 coercion
Date: 2016-05-23 17:05:41
Message-ID: CADBa3waX4s-B1WNe4r5tdRW7m-MbJaf1TKyU+ud4fStJCrxZOw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I see, so the overriding, default rule in all these cases is, "convert as
many digits as will be reliable" -- as opposed to, "convert as many digits
as are needed to do a full round-trip"?

Best,
Charles

On Mon, May 23, 2016 at 10:00 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Charles <cooper(dot)charles(dot)m(at)gmail(dot)com> writes:
> > As a follow-up question, I am a bit confused as to the following
> behavior:
> > ...
> > How come 11143.1504 is not printed in all of these cases?
>
> float4 to numeric casting doesn't honor extra_float_digits, it just
> converts as many digits as will be reliable.
>
> regards, tom lane
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2016-05-23 19:02:41 Re: [BUGS] BUG #14153: Unrecognized node type error when upsert is present in recursive CTE
Previous Message Tom Lane 2016-05-23 17:00:08 Re: BUG #14138: Inconsistent rounding behavior in float4 coercion