Re: [HACKERS] bug in numeric_power() function

2008-03-14 Thread Richard Wang
I also have a question here: isn't dpow enough for calculation? Why added numeric_power? "Tom Lane" <[EMAIL PROTECTED]> дÈëÏûÏ¢ÐÂÎÅ:[EMAIL PROTECTED] > "Richard Wang" <[EMAIL PROTECTED]> writes: >> I expected 0 ^ 123.3 to be 0, but it reported error as follows >> postgres=# select 0 ^ 123.3; >> ER

Re: [HACKERS] bug in numeric_power() function

2008-03-11 Thread Tom Lane
"Richard Wang" <[EMAIL PROTECTED]> writes: > I expected 0 ^ 123.3 to be 0, but it reported error as follows > postgres=# select 0 ^ 123.3; > ERROR: cannot take logarithm of zero Hmm, seems like the numeric and float8 power operators don't agree about 0^0 either... regards

Re: [HACKERS] bug in numeric_power() function

2008-03-11 Thread Dann Corbit
> -Original Message- > From: [EMAIL PROTECTED] [mailto:pgsql-hackers- > [EMAIL PROTECTED] On Behalf Of Richard Wang > Sent: Tuesday, March 11, 2008 7:38 PM > To: pgsql-hackers@postgresql.org > Subject: [HACKERS] bug in numeric_power() function > > I expected 0

[HACKERS] bug in numeric_power() function

2008-03-11 Thread Richard Wang
I expected 0 ^ 123.3 to be 0, but it reported error as follows postgres=# select 0 ^ 123.3; ERROR: cannot take logarithm of zero I find that there is a bug in numeric_power() function the function caculates a ^ b based on the algorithm e ^ (lna * b) as you see, ln0 is not valid -- Sent via