| From: | Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com> |
|---|---|
| To: | Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, pgsql-docs(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Question to datatype.sgml |
| Date: | 2019-12-30 00:52:48 |
| Message-ID: | 79565c24-89ed-abfd-46df-4a23cde21b04@2ndquadrant.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-docs |
On 30/12/2019 01:34, Tatsuo Ishii wrote:
> Hi,
>
> Can you please someone elaborate what's the meaning of "even" in
> datatype.sgml?
>
> <para>
> By default, floating point values are output in text form in their
> shortest precise decimal representation; the decimal value produced is
> closer to the true stored binary value than to any other value
> representable in the same binary precision. (However, the output value is
> currently never <emphasis>exactly</emphasis> midway between two
> representable values, in order to avoid a widespread bug where input
> routines do not properly respect the round-to-even rule.) This value will
> ~~~~~~~~~~~~~~~~~~~
> use at most 17 significant decimal digits for <type>float8</type>
> values, and at most 9 digits for <type>float4</type> values.
> </para>
>
> I think "even" means "equality" here, not "even" of "even and odd".
It does actually mean "even and odd". This kind of rounding is also
called "Banker's Rounding".
https://en.wikipedia.org/wiki/Rounding#Round_half_to_even
--
Vik Fearing
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tatsuo Ishii | 2019-12-30 02:07:36 | Re: Question to datatype.sgml |
| Previous Message | Tatsuo Ishii | 2019-12-30 00:34:51 | Question to datatype.sgml |