| От | Tom Lane |
|---|---|
| Тема | Re: [GENERAL] Does NUMERIC lose precision? |
| Дата | |
| Msg-id | 2321.1496093050@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | [GENERAL] Does NUMERIC lose precision? (Kaiting Chen <ktchen14@gmail.com>) |
| Список | pgsql-general |
Kaiting Chen <ktchen14@gmail.com> writes:
> Hi everyone. I’m trying to perform some exact precision arithmetic with PostgreSQL’s NUMERIC type. However I can’t
seemto get the unparameterized NUMERIC type to perform exact precision arithmetic:
Division is inherently inexact, except in special cases. If you think
that 1/(2^64) should be carried out to enough digits to be exact,
what would you have us do with 1/3?
The actual behavior is that it will choose a result scale (number of
digits after the decimal point) that is dependent on the scales of the
input arguments, but not on their precise values. I don't recall the
details beyond that.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера