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

From Jan Wieck
Subject Re: numeric precision when raising one numeric to another.
Date
Msg-id 42A47324.2060705@Yahoo.com
Whole thread Raw
In response to Re: numeric precision when raising one numeric to another.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On 5/20/2005 2:26 PM, Tom Lane wrote:

> numeric_power can in theory deliver an exact answer when the exponent is
> a positive integer.  Division can deliver an exact answer in some cases
> too --- but the spec doesn't say it must do so when possible.  So I
> would say that there is no spec requirement for special behavior for
> integral exponents.

There are cases where a numeric_power could in theory deliver an exact
answer for a fractional exponent. That is when the exponent is a natural
fraction because the result is the m'th root of x^n (for n/m). As an
example 4^1.5 = 8. Of course does the m'th root need to produce a finite
result, which I think is not guaranteed for arbitrary numbers.

I'm not advocating to do that, just saying it is theoretically possible
for a subset of possible inputs.


Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #

pgsql-general by date:

Previous
From: Ying Lu
Date:
Subject: which commands under PostgreSQL do the similar func provided by "show processlist" under mysql
Next
From: Chris Browne
Date:
Subject: Re: postgresql books