Re: pgsql: Fix NUMERIC modulus to properly truncate

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Bruce Momjian <momjian(at)svr1(dot)postgresql(dot)org>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Fix NUMERIC modulus to properly truncate
Date: 2005-06-04 15:41:18
Message-ID: 42A1CB9E.7090400@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Is this a backport?

Bruce Momjian wrote:
> Log Message:
> -----------
> Fix NUMERIC modulus to properly truncate division in computation.
> Division rounding was causing incorrect results. Test case:
>
> test=> SELECT 12345678901234567890 % 123;
> ?column?
> ----------
> 78
> (1 row)
>
> Was returning -45.
>
> Modified Files:
> --------------
> pgsql/src/backend/utils/adt:
> numeric.c (r1.83 -> r1.84)
> (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/numeric.c.diff?r1=1.83&r2=1.84)
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2005-06-04 15:45:46 Re: pgsql: Fix NUMERIC modulus to properly truncate
Previous Message Bruce Momjian 2005-06-04 14:12:50 pgsql: Fix NUMERIC modulus to properly truncate division in computation.

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2005-06-04 15:43:14 Re: Precedence of %
Previous Message Bruce Momjian 2005-06-04 15:38:05 Re: Precedence of %