Re: numeric precision when raising one numeric to another. - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: numeric precision when raising one numeric to another.
Date
Msg-id 20050524161000.GE8743@surnet.cl
Whole thread Raw
In response to Re: numeric precision when raising one numeric to another.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: numeric precision when raising one numeric to another.
List pgsql-general
On Fri, May 20, 2005 at 01:03:08PM -0400, Tom Lane wrote:

> But having said that, I don't have a problem with putting in a
> pg_operator entry for numeric_power.  And if someone wants to improve
> the scale factor calculations therein, go for it.

Oh, and while at it, it would be nice to solve the modulo bug that still
lurks there:

alvherre=# select 12345678901234567890 % 123;
 ?column?
----------
      -45
(1 fila)

alvherre=# select 12345678901234567890 % 123::numeric(4,1);
 ?column?
----------
     78.0
(1 fila)

alvherre=# select 12345678901234567890 % 123::numeric(3,0);
 ?column?
----------
      -45
(1 fila)

alvherre=# select version();
                                           version
----------------------------------------------------------------------------------------------
 PostgreSQL 8.1devel on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.6 (Debian 1:3.3.6-4)
(1 fila)

--
Alvaro Herrera (<alvherre[a]surnet.cl>)
"I call it GNU/Linux. Except the GNU/ is silent." (Ben Reiter)

pgsql-general by date:

Previous
From: Sebastian Böck
Date:
Subject: Re: Update on tables when the row doesn't change
Next
From: Marc Soleda
Date:
Subject: pg_autovacuum WinXP service