Re: Rounding strategy
Laurenz Albe <laurenz.albe@cybertec.at>
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: rudolphfroger@dreamsolution.nl, pgsql-docs@lists.postgresql.org
Date: 2021-04-22T16:54:54Z
Lists: pgsql-docs
Attachments
- 0001-Document-tie-breaking-behavior-of-round.patch (text/x-patch) patch 0001
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
Commits
-
Doc: document the tie-breaking behavior of the round() function.
- 82b13dbc4d4b 14.0 landed
- 00037d8d0040 13.3 landed