Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit82b13db

Browse files
committed
Doc: document the tie-breaking behavior of the round() function.
Back-patch to v13; the table layout in older branches is unfriendlyto adding such details.Laurenz AlbeDiscussion:https://postgr.es/m/161881920775.685.12293798764864559341@wrigleys.postgresql.org
1 parent4c4eaf3 commit82b13db

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,10 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
15681568
<returnvalue>double precision</returnvalue>
15691569
</para>
15701570
<para>
1571-
Rounds to nearest integer
1571+
Rounds to nearest integer. For <type>numeric</type>, ties are
1572+
broken by rounding away from zero. For <type>double precision</type>,
1573+
the tie-breaking behavior is platform dependent, but
1574+
<quote>round to nearest even</quote> is the most common rule.
15721575
</para>
15731576
<para>
15741577
<literal>round(42.4)</literal>
@@ -1583,7 +1586,7 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
15831586
</para>
15841587
<para>
15851588
Rounds <parameter>v</parameter> to <parameter>s</parameter> decimal
1586-
places
1589+
places. Ties are broken by rounding away from zero.
15871590
</para>
15881591
<para>
15891592
<literal>round(42.4382, 2)</literal>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp