Re: numeric precision when raising one numeric to another.

Поиск
Список
Период
Сортировка
От Florian G. Pflug
Тема Re: numeric precision when raising one numeric to another.
Дата
Msg-id 428E1DF1.6020404@phlo.org
обсуждение исходный текст
Ответ на Re: numeric precision when raising one numeric to another.  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Ответы Re: numeric precision when raising one numeric to  (Scott Marlowe <smarlowe@g2switchworks.com>)
Re: numeric precision when raising one numeric to another.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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


Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: "Florian G. Pflug"
Дата:
Сообщение: Re: numeric precision when raising one numeric to another.
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: numeric precision when raising one numeric to