| От | Bruno Wolff III |
|---|---|
| Тема | Re: Arbitrary precision modulo operation |
| Дата | |
| Msg-id | 20040428070443.GC6901@wolff.to обсуждение |
| Ответ на | Re: Arbitrary precision modulo operation (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-general |
On Wed, Apr 28, 2004 at 02:01:00 -0400, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Paul Tillotson <pntil@shentel.net> writes: > > mod(x, y) is computed as x - trunc(x / y) * y in the mod_var() function > > It could be that select_div_scale needs to allow some more slop, or that > that routine is okay but mod_var shouldn't depend on it to select the > intermediate result scale for its internal division. Comments? 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. Another option would be for mod to check if the remainder doesn't have the same sign as the divisor and if so keeping adding the divisor to it until it does.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера