| От | Tom Lane |
|---|---|
| Тема | Re: Floating point problem? |
| Дата | |
| Msg-id | 22366.1151352672@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Floating point problem? (Chito Lapena <chito@webims.com>) |
| Список | pgsql-bugs |
Chito Lapena <chito@webims.com> writes:
> This has become more of a prominent problem as we've added more data
> integrity checks in our code... We are getting errors like the following
> from our debug output:
> EMP ID: 3 Ledger balance mismatch - record: 116.1 Ledger: 116.1 diff:
> 1.52588e-05
> record: float4
> ledger: float4
If you are expecting exact results, you should be using an exact
datatype, ie numeric. Floating-point calculations are inherently
inexact ... *especially* with float4, which only has about six
significant digits at best.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера