Re: [HACKERS] bug in numeric_power() function - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: [HACKERS] bug in numeric_power() function
Date
Msg-id 200805072222.m47MM5c04761@momjian.us
Whole thread Raw
In response to Re: [HACKERS] bug in numeric_power() function  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] bug in numeric_power() function
List pgsql-patches
Tom Lane wrote:
> Bruce Momjian <bruce@momjian.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@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

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

pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] bug in numeric_power() function
Next
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] bug in numeric_power() function