Re: numeric precision when raising one numeric to

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>, Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>, "John D(dot) Burger" <john(at)mitre(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: numeric precision when raising one numeric to
Date: 2005-05-30 20:58:43
Message-ID: 200505302058.j4UKwhV16426@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Has anyone bothered to actually look into the code?
>
> regression=# select power(2::numeric,1000);
> power
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> 10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376.0000000000000000
> (1 row)
>
> AFAICT the only thing missing is a pg_operator entry linked to the
> function.

Patch to add NUMERIC ^ NUMERIC operator added and applied. Catalog
version bumped. This will be in 8.1. FYI, this already does the right
thing (no rounding) if the second argument is an integal value, see
power_var().

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 1.6 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-05-30 21:06:00 Re: CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT
Previous Message Bruce Momjian 2005-05-30 20:30:25 Re: CREATE TEMP TABLE AS SELECT/ GET DIAGNOSTICS ROW_COUNT