x * (5**1) = x * 5 x * (0**1) = x * 0 = 0 x * (5**0) = x x * (0**0) = x
A useful way to think about it is that the exponent is telling you how many times to multiply by something. If you multiply x by 5 once you get 5x. If you don't multiply it by 5 at all, you just have the x you started with. That's the same as multiplying it by 5 zero times, and the same as multiplying it by 1.

If you don't multiply x by 0 at all, you still have the x you started with. It gives the same as multiplying x by one, so that's why we can say the value of 0**0 is 1.

As bart indicates, 0**0 is a bit of a strange consruct, whith strange relatives, but for simpler operations like the arithmetic most of us normally do in perl, it's really helpful to have it's value be 1, not undefined.

Hope this helps.


In reply to Re: zero to the power zero by rodion
in thread zero to the power zero by perlance

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.