Re: Arbitrary precision modulo operation

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Arbitrary precision modulo operation
Дата
Msg-id 20040429011145.GA19590@wolff.to
обсуждение исходный текст
Ответ на Re: Arbitrary precision modulo operation  ("Dann Corbit" <DCorbit@connx.com>)
Список pgsql-general
On Wed, Apr 28, 2004 at 14:02:57 -0700,
  Dann Corbit <DCorbit@connx.com> wrote:
>
>
> > -----Original Message-----
> > From: Bruno Wolff III [mailto:bruno@wolff.to]
> >
> > One option would be to define a separate division operator
> > that always returns an integral value and that is truncated
> > toward 0 and use that for the mod function. People might find
> > this operator useful in itself.
>
> It will give some wrong results.  The result of mod should be the
> remainder after division, which is not always integral in the case of
> numeric fixed point or floating point.
> Consider the output of this program:

The remainder may not be integral but the quotient should be. However the
idea of getting the quotient, multiplying by the divisor and subtracting
from the dividend is not very good from an efficiancy point of view.

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Arbitrary precision modulo operation
Следующее
От: Rob
Дата:
Сообщение: postgresql web problems?