Re: [GENERAL] Modulus operator returns negative values / numeric

2005-05-26 Thread Alvaro Herrera
On Thu, May 26, 2005 at 08:56:34AM -0400, Paul Tillotson wrote: > Tom Lane wrote: > > >Paul Tillotson <[EMAIL PROTECTED]> writes: > In other words, no arbitrary number of extra decimal places when calling > div_var() will be always sufficient to prevent rounding up at some other > decimal place

Re: [GENERAL] Modulus operator returns negative values / numeric

2005-05-26 Thread Paul Tillotson
Tom Lane wrote: Paul Tillotson <[EMAIL PROTECTED]> writes: I don't think anyone wants to defend the negative modulus as such, but to fix it, we have to do one of these: (1) Keep rounding division, but rewrite the numeric modulus operator to use a form of division that always rou

Re: [GENERAL] Modulus operator returns negative values / numeric division rounds up sometimes

2005-05-25 Thread Tom Lane
Paul Tillotson <[EMAIL PROTECTED]> writes: > I don't think anyone wants to defend the negative modulus as such, but to fix > it, we have to do one of these: > (1) Keep rounding division, but rewrite the numeric modulus operator to use a > form of division that always rounds towards zero. > or