Question to datatype.sgml
Question to datatype.sgml
От:
Tatsuo Ishii <ishii@sraoss.co.jp>
Дата:
Hi,
Can you please someone elaborate what's the meaning of "even" in
datatype.sgml?
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 exactly 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 float8
values, and at most 9 digits for float4 values.
I think "even" means "equality" here, not "even" of "even and odd".
Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp
Re: Question to datatype.sgml
От:
Vik Fearing <vik.fearing@2ndquadrant.com>
Дата:
On 30/12/2019 01:34, Tatsuo Ishii wrote: > Hi, > > Can you please someone elaborate what's the meaning of "even" in > datatype.sgml? > > > 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 exactly 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 float8 > values, and at most 9 digits for float4 values. > > > 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
Re: Question to datatype.sgml
От:
Tatsuo Ishii <ishii@sraoss.co.jp>
Дата:
> On 30/12/2019 01:34, Tatsuo Ishii wrote: >> Hi, >> >> Can you please someone elaborate what's the meaning of "even" in >> datatype.sgml? >> >> >> 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 exactly 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 float8 >> values, and at most 9 digits for float4 values. >> >> >> 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 Oh, Thanks! The link is very helpful. -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese:http://www.sraoss.co.jp
Re: Question to datatype.sgml
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Tatsuo Ishii writes: >>> Can you please someone elaborate what's the meaning of "even" in >>> datatype.sgml? >>>> representable values, in order to avoid a widespread bug where input >>>> routines do not properly respect the round-to-even rule.) This value will >> 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 > Oh, Thanks! The link is very helpful. I think actually the standard terminology is "round-to-nearest-even". regards, tom lane
Re: Question to datatype.sgml
От:
Tatsuo Ishii <ishii@sraoss.co.jp>
Дата:
>>> 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 > >> Oh, Thanks! The link is very helpful. > > I think actually the standard terminology is "round-to-nearest-even". Ok, I will change it to "round-to-nearest-even" if there's no objection. Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese:http://www.sraoss.co.jp
Re: Question to datatype.sgml
От:
Tatsuo Ishii <ishii@sraoss.co.jp>
Дата:
>> I think actually the standard terminology is "round-to-nearest-even". > > Ok, I will change it to "round-to-nearest-even" if there's no objection. Done. Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese:http://www.sraoss.co.jp