Re: [HACKERS] Floating point error

From: Maciek Sakrejda <m(dot)sakrejda(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>, "Daniel Farina *EXTERN*" <daniel(at)heroku(dot)com>, "Tom Duffey *EXTERN*" <tduffey(at)trillitech(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Floating point error
Date: 2013-03-05 18:36:05
Message-ID: CAOtHd0BfNOKyCoKm9fniGDL28YRFEu16XK-Hp3prQy5jLoTbVA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Tue, Mar 5, 2013 at 10:23 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Why the discrepancy between
>> default behavior and what pg_dump gets?
>
> Basically, the default behavior is tuned to the expectations of people
> who think that what they put in is what they should get back, ie we
> don't want the system doing this by default:
>
> regression=# set extra_float_digits = 3;
> SET
> regression=# select 0.1::float4;
> float4
> -------------
> 0.100000001
> (1 row)
>
> regression=# select 0.1::float8;
> float8
> ---------------------
> 0.10000000000000001
> (1 row)
>
> We would get a whole lot more bug reports, not fewer, if that were
> the default behavior.

Isn't this a client rendering issue, rather than an on-the-wire encoding issue?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2013-03-05 18:38:47 Re: [HACKERS] Floating point error
Previous Message Tom Lane 2013-03-05 18:27:03 Re: 9.2 timestamp function syntax error

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-03-05 18:38:47 Re: [HACKERS] Floating point error
Previous Message Tom Lane 2013-03-05 18:23:12 Re: [HACKERS] Floating point error