Re: [HACKERS] bug in numeric_power() function

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Richard Wang <ruc_wang(at)hotmail(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] bug in numeric_power() function
Date: 2008-05-07 22:22:05
Message-ID: 200805072222.m47MM5c04761@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > I have developed the attached patch which fixes 0 ^ 123.3.
>
> Did you actually read the wikipedia entry you cited?

Yes:

The evaluation of 0^0 presents a problem, because different mathematical
reasoning leads to different results. The best choice for its value
depends on the context. According to Benson (1999), "The choice whether
to define 00 is based on convenience, not on correctness."[2] There are
two principal treatments in practice, one from discrete mathematics and
the other from analysis.

...

The computer programming languages that evaluate 00 to be 1[8] include
J, Java, Python, Ruby, Haskell, ML, Scheme, MATLAB, bc, R programming
language, and Microsoft Windows' Calculator.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2008-05-07 22:32:21 Re: [HACKERS] bug in numeric_power() function
Previous Message Peter Eisentraut 2008-05-07 22:22:03 Re: [HACKERS] bug in numeric_power() function

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2008-05-07 22:32:21 Re: [HACKERS] bug in numeric_power() function
Previous Message Peter Eisentraut 2008-05-07 22:22:03 Re: [HACKERS] bug in numeric_power() function