Rounding strategy of round function

From: Rudolph Froger <rudolphfroger(at)dreamsolution(dot)nl>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Rounding strategy of round function
Date: 2021-03-26 14:46:08
Message-ID: ce181e29-2bb2-5f98-b405-351bea1885af@dreamsolution.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The 'round' mathematical function doesn't document which rounding
strategy it uses. 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 is the function seems to round to nearest
with ties (a 5) 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 Stephen Frost 2021-03-26 21:21:15 Re: TLS acronym
Previous Message David Steele 2021-03-25 13:00:11 Re: Additional Chapter for Tutorial - arch-dev.sgml