Rounding strategy of the 'round' function

From: Rudolph Froger <rudolphfroger(at)dreamsolution(dot)nl>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Rounding strategy of the 'round' function
Date: 2021-04-07 19:06:44
Message-ID: 84366276-5142-da72-b5c3-0b3bab186ff5@dreamsolution.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Hi,

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.

https://www.postgresql.org/docs/current/functions-math.html

Kind regards, Rudolph

Browse pgsql-docs by date

  From Date Subject
Next Message Peter Eisentraut 2021-04-08 09:00:34 Re: Change JOIN tutorial to focus more on explicit joins
Previous Message Peter Eisentraut 2021-04-07 11:54:34 Re: "there is no way to insert less than one row"