Re: numeric precision when raising one numeric to another.

From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: numeric precision when raising one numeric to another.
Date: 2005-05-20 17:27:13
Message-ID: 428E1DF1.6020404@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stephan Szabo wrote:
> On Fri, 20 May 2005, John D. Burger wrote:
>
>
>>I find all these statements about the near-uselessness of
>>NUMERIC^NUMERIC to be pretty amazing. It's fine to say, "no one seems
>>to be asking for this, so we haven't implemented it yet", but, c'mon,
>>folks, Postgres gets used for more than "business cases".
>
> If people don't see the use of a function they aren't going to implement
> it. In addition, there is a small, but non-zero cost to adding a
> function/operator to the system (in the cost to maintain it at the very
> least) and if the general belief is that the function or operator is
> useless or nearly useless then it simply may not be worth adding.

It's not only useless, it's dangerous. As fas as I know, numeric
_guarantees_ the result of a operation to be correct to the last digit.
This is _impossible_ to archive in the general case (thing 2^(1/2)) -
and therefor, there should be no pow(numeric, numeric). There should be
a pow(numeric, int), and maybe a pow(numeric, float) - and certainly
there should be (and is) an pow(float, float) - but pow(numeric,
numeric) defeats the whole purpose of the numeric type.

greetings, Florian Pflug

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2005-05-20 17:29:10 Re: numeric precision when raising one numeric to
Previous Message Florian G. Pflug 2005-05-20 17:23:40 Re: numeric precision when raising one numeric to another.