Explanation of the ROUND function with NUMERIC as an argument

Поиск
Список
Период
Сортировка
От PG Doc comments form
Тема Explanation of the ROUND function with NUMERIC as an argument
Дата
Msg-id 167005767233.1899.2490889277144246641@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: Explanation of the ROUND function with NUMERIC as an argument  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-docs
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/15/bug-reporting.html
Description:

I think the manual's description of the round function with numeric as an
argument is different from the actual behavior.

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

Explanation of the manual's ROUND function
round ( numeric ) → numeric
round ( double precision ) → double precision
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) → 42

Operation of the ROUND function
postgres=# SELECT round(CAST(42.5 AS numeric));
 round
-------
    43
(1 row)

I am thinking that the value of the ROUND function with NUMERIC as an
argument is rounded off, not rounded away from zero.

В списке pgsql-docs по дате отправления:

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: First Person being used (only occurs in 2 other places in all of documentation)
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: Explanation of the ROUND function with NUMERIC as an argument