Re: Arbitrary precision arithmatic with pgsql - Mailing list pgsql-sql

From Michael Glaesemann
Subject Re: Arbitrary precision arithmatic with pgsql
Date
Msg-id 1089006C-FB4B-11D8-A2A0-000A95C88220@myrealbox.com
Whole thread Raw
In response to Re: Arbitrary precision arithmatic with pgsql  (Michael Glaesemann <grzm@myrealbox.com>)
Responses Re: Arbitrary precision arithmatic with pgsql
List pgsql-sql
On Aug 31, 2004, at 9:17 PM, Michael Glaesemann wrote:

> What you need is a power operation for numeric, which I think you'd 
> have to write yourself,

Looking a little closer, there is a pow() function that takes two 
numeric arguments and returns numeric.

<http://www.postgresql.org/docs/current/static/functions-math.html>

test=# select pow(2::numeric,100::numeric);                       pow
-------------------------------------------------- 1267650600228229401496703205376.0000000000000000
(1 row)

Sorry for the misinformation.

If you'd like, I think you can overload the ^ operator to work on 
numeric as well if you don't want to use pow(). See the following page 
for more information.

<http://www.postgresql.org/docs/current/static/sql-createoperator.html>

Michael Glaesemann
grzm myrealbox com



pgsql-sql by date:

Previous
From: Rajesh Kumar Mallah
Date:
Subject: Re: Arbitrary precision arithmatic with pgsql
Next
From: Rajesh Kumar Mallah
Date:
Subject: Re: Arbitrary precision arithmatic with pgsql