Re: Rounding strategy

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: rudolphfroger(at)dreamsolution(dot)nl, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Rounding strategy
Date: 2021-04-22 16:54:54
Message-ID: bc1b85d65c284e3aaa718eba5f43dd4b970ccf33.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Mon, 2021-04-19 at 08:00 +0000, PG Doc comments form wrote:
> The 'round' mathematical function documentation doesn't specify its rounding
> strategy. If this would be documented then users can rely on its rounding
> behavior. For double precision the rounding probably depends on your
> platform. For numeric the function seems to round to nearest with ties going
> away from zero (sometimes referred to as "round half up). 6.5 -> 7.0 and
> -6.5 -> -7.0.

Here is a proposed patch.

Yours,
Laurenz Albe

Attachment Content-Type Size
0001-Document-tie-breaking-behavior-of-round.patch text/x-patch 1.2 KB

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2021-04-22 17:50:20 Re: Rounding strategy
Previous Message PG Doc comments form 2021-04-22 13:36:30 Chapter 30. Logical Replication slightly unclear