Re: Infinity vs Error for division by zero
От | David G. Johnston |
---|---|
Тема | Re: Infinity vs Error for division by zero |
Дата | |
Msg-id | CAKFQuwYMupdizqDihYjr+rfn4s6MUn6coB4JRw6iJTe2D2yDiQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Infinity vs Error for division by zero (Chapman Flack <chap@anastigmatix.net>) |
Ответы |
Re: Infinity vs Error for division by zero
Re: Infinity vs Error for division by zero |
Список | pgsql-hackers |
But if someone wanted to write a user-defined division function or
operator that would return Inf for (anything > 0) / 0 and for
(anything < 0) / -0, and -Inf for (anything < 0) / 0 and for
(anything > 0) / -0, and NaN for (either zero) / (either zero), I think
that function or operator would be fully in keeping with IEEE 754.
For my part in the queries I have that encounter divide-by-zero I end up transforming the result to zero which is considerably easier to present/absorb along side other valid fractions in a table or chart.
David J.
В списке pgsql-hackers по дате отправления: