diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2021-04-22 14:47:26 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2021-04-22 14:47:26 -0400 |
commit | 82b13dbc4d4b46f71ca95ce1cc15c425deff5957 (patch) | |
tree | 0a602c8e1f14ba429ef6e7e6d6ca6f57f0230ddc /doc/src | |
parent | 4c4eaf3d19201c5e2d9efebc590903dfaba0d3e5 (diff) | |
download | postgresql-82b13dbc4d4b46f71ca95ce1cc15c425deff5957.tar.gz postgresql-82b13dbc4d4b46f71ca95ce1cc15c425deff5957.zip |
Doc: document the tie-breaking behavior of the round() function.
Back-patch to v13; the table layout in older branches is unfriendly
to adding such details.
Laurenz Albe
Discussion: https://postgr.es/m/161881920775.685.12293798764864559341@wrigleys.postgresql.org
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/func.sgml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index d2011634075..5bba13973f3 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1568,7 +1568,10 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue> <returnvalue>double precision</returnvalue> </para> <para> - Rounds to nearest integer + Rounds to nearest integer. For <type>numeric</type>, ties are + broken by rounding away from zero. For <type>double precision</type>, + the tie-breaking behavior is platform dependent, but + <quote>round to nearest even</quote> is the most common rule. </para> <para> <literal>round(42.4)</literal> @@ -1583,7 +1586,7 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue> </para> <para> Rounds <parameter>v</parameter> to <parameter>s</parameter> decimal - places + places. Ties are broken by rounding away from zero. </para> <para> <literal>round(42.4382, 2)</literal> |