Re: Modulus operator returns negative values / numeric - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Modulus operator returns negative values / numeric
Date
Msg-id 20050526154201.GE7589@surnet.cl
Whole thread Raw
In response to Re: Modulus operator returns negative values / numeric  (Paul Tillotson <pntil@shentel.net>)
List pgsql-general
On Thu, May 26, 2005 at 08:56:34AM -0400, Paul Tillotson wrote:
> Tom Lane wrote:
>
> >Paul Tillotson <pntil@shentel.net> 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.

No, an arbitrary number won't do.  I found I could make it work by
adding as much extra decimals as digits in the divisor.  At least it
worked for these test cases I made up.  (Attached)

> >I cannot believe that that won't create problems at least as bad as it
> >solves.  Have you even tried the regression tests on this?

> <sheepish grin>  No.  Can you tell me how to do that?

make installcheck in src/test/regress

--
Alvaro Herrera (<alvherre[a]surnet.cl>)
"Cómo ponemos nuestros dedos en la arcilla del otro. Eso es la amistad; jugar
al alfarero y ver qué formas se pueden sacar del otro" (C. Halloway en
La Feria de las Tinieblas, R. Bradbury)

Attachment

pgsql-general by date:

Previous
From: Douglas McNaught
Date:
Subject: Re: Query for importing and exporting data from a database
Next
From: "David M. Lee"
Date:
Subject: Portability of pgsql database files.