| От | Tom Lane |
|---|---|
| Тема | Re: int4, int8, real ....division... |
| Дата | |
| Msg-id | 2110.1085071301@sss.pgh.pa.us обсуждение |
| Ответ на | int4, int8, real ....division... ("Gyenese Pál Attila" <gyenese@mediagnost.hu>) |
| Ответы |
Re: int4, int8, real ....division...
|
| Список | pgsql-bugs |
"Gyenese Pál Attila" <gyenese@mediagnost.hu> writes:
> REASON IS:
> SELECT 365*10000000 ;
> result: -644967296
> wrong
This isn't a division problem --- the difficulty is there's no check for
overflow in int4 multiplication. (Nor in any of the other integer
arithmetic operations, for that matter.)
It'd be nice if C made it easier to detect integer overflow :-(
... AFAIK, testing this would make those subroutines many times slower,
which is pretty annoying when the hardware already knows whether the
result overflowed or not.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера