Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-25 21:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found