Semantics of ^^

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Wed Dec 9 08:51:16 PST 2009


Bill Baxter wrote:
> On Tue, Dec 8, 2009 at 7:24 PM, Don <nospam at nospam.com> wrote:
>>>> * If y == 0,  x ^^ y is 1.
>>> Need to mention what happens when x is also 0.
>> No.  0^^0 is 1, as well.
> 
> Is it?  That's rather embarrassing for Wolfram Alpha, then (and
> presumably Mathematica, too) since they have it as "indeterminate":
>    http://www.wolframalpha.com/input/?i=0^0

It's not an either-or question. There are different definitions of 0^0, 
and it's not obvious which is the "best one":

   http://en.wikipedia.org/wiki/Exponentiation#Zero_to_the_zero_power

I think 0^^0 should give the same result as 0.0^^0.0, for which C has 
set the precedent that pow(0.0, 0.0)==1.0.

-Lars



More information about the Digitalmars-d mailing list