Skip site navigation (1) Skip section navigation (2)

Re: some errors and/or bugs?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "He Weiping(Laser Henry)" <laser(at)zhengmai(dot)com(dot)cn>, <pgsql-docs(at)postgresql(dot)org>
Subject: Re: some errors and/or bugs?
Date: 2000-12-19 16:36:37
Message-ID: Pine.LNX.4.30.0012191732170.1000-100000@peter.localdomain (view raw, whole thread or download thread mbox)
Lists: pgsql-docs
Tom Lane writes:

> It's correct, if the underlying float arithmetic is IEEE-compliant.
> Rounding for exact half-integral values is supposed to be "round to
> nearest even".  So 42.5 goes to 42, but 43.5 goes to 44.
> I notice our NUMERIC rounding code does not do that ... perhaps it
> should.

More precisely, an IEEE-compliant system would offer the choice of
rounding up, rounding down, rounding toward zero, or rounding toward even.
I would guess that the default is merely the potentially best performing.

We could offer these options (much more easily) for the numeric case, but
since numeric is very often used for business type applications, the
customary rounding method (up) should be preferred.

Peter Eisentraut      peter_e(at)gmx(dot)net

In response to


pgsql-docs by date

Next:From: Christopher MastoDate: 2000-12-19 18:33:58
Subject: Re: Who is a maintainer of GiST code ?
Previous:From: Ryan KirkpatrickDate: 2000-12-19 01:59:34
Subject: Re: 7.1 features list

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group