bug in numeric_power() function

From: "Richard Wang" <ruc_wang(at)hotmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: bug in numeric_power() function
Date: 2008-03-12 02:37:34
Message-ID: fr7flt$2j04$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dann Corbit 2008-03-12 05:05:07 Re: bug in numeric_power() function
Previous Message longlong 2008-03-12 01:43:33 Fwd: COPY issue(gsoc project)

Browse pgsql-patches by date

  From Date Subject
Next Message Dann Corbit 2008-03-12 05:05:07 Re: bug in numeric_power() function
Previous Message Tom Lane 2008-03-12 02:06:59 Re: Configurable Penalty Costs for Levenshtein