Doc: document the tie-breaking behavior of the round() function.
authorTom Lane
Thu, 22 Apr 2021 18:47:26 +0000 (14:47 -0400)
committerTom Lane
Thu, 22 Apr 2021 18:47:26 +0000 (14:47 -0400)
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

doc/src/sgml/func.sgml

index e3f833d231f8610b5fc60ceadc341e0865f40314..60ac5ef6585a2ec2c56b688ffd78079eb40a7251 100644 (file)
@@ -1617,7 +1617,10 @@ repeat('Pg', 4) PgPgPgPg
         double precision
        
        
-        Rounds to nearest integer
+        Rounds to nearest integer.  For numeric, ties are
+        broken by rounding away from zero.  For double precision,
+        the tie-breaking behavior is platform dependent, but
+        round to nearest even is the most common rule.
        
        
         round(42.4)
@@ -1632,7 +1635,7 @@ repeat('Pg', 4) PgPgPgPg
        
        
         Rounds v to s decimal
-        places
+        places.  Ties are broken by rounding away from zero.
        
        
         round(42.4382, 2)