Well, the logarithm seems to agree.
0**0 = 1
log(1) / log(0) = 0
For those of you who don't remember logs, they allow you to figure out the exponent needed to get y from x. i.e.
log(y) / log(x) = z for x != 1 (since log(1) = 0, avoid div by zero)
x**z = y
Yeah, my point doesn't seem very valuable, but that's how I cope with 0**0 = 1.
Update: I know that log(0) = -infinity. I understand that I used the limit of log(1) / log(0) as log(0) approaches -infinity (travelling from right) to get my answer that 0**0 = 1. Approaching from the left results in
undef since log(-x) does not exist (this is because
en = -x means that
i is a factor of e, in which case n is even...in the integer sense, let's not cloud the issue with reals) and anything divided by nothing (not nothing in the zero sense but nothing in the undefined sense) doesn't exist.
In short, depends upon which side you're coming from. I like both answers, but you 0**0 = undef guys were giving the 0**0 = 1 people a hard time.
Another interesting note:
0**x = ? as x approaches 0 from the right would result in ? being 0. From the left again is undefined since 0**-x = 1 / 0**x. Since 0**x = 0 for x > 0, you'd be dividing by 0 to give you the undefined value.
So let's see, the score stands:
0**0 = 1 => 1 point
0**0 = 0 => 1 point
0**0 = undef => 2 points
Hmmm...maybe somebody from my 0**0 = 1 team can boost our score again.
wait...
% perl -le 'print 0**0'
1
Let's see the scores now:
0**0 = 0 => 1 point
0**0 = undef => 2 points
0**0 = 1 => since perl says so, infinite points
;-) Sorry this is so long.
In reply to Re: 0**0
by antirice
in thread 0**0
by Juerd
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.