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@xxxxxxxxx # ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match