in reply to Re: 0**0
in thread order of arguments evaluated

sci.math FAQ: What is 0^0?...
According to some Calculus textbooks, 0^0 is an ``indeterminate form''. When evaluating a limit of the form 0^0, then you need to know that limits of that form are called ``indeterminate forms'', and that you need to use a special technique such as L'Hopital's rule to evaluate them. Otherwise, 0^0 = 1 seems to be the most useful choice for 0^0. This convention allows us to extend definitions in different areas of mathematics that otherwise would require treating 0 as a special case. Notice that 0^0 is a discontinuity of the function x^y. More importantly, keep in mind that the value of a function and its limit need not be the same thing, and functions need not be continous, if that serves a purpose (see Dirac's delta). This means that depending on the context where 0^0 occurs, you might wish to substitute it with 1, indeterminate or undefined/nonexistent...

Replies are listed 'Best First'.
Re^3: 0**0
by gregor42 (Parson) on May 31, 2005 at 18:03 UTC

    Perhaps I'm missing the point - could you elaborate further how that relates to Perl?

    Think about 0**0. What should that value be? You can devise arguments that it could be either 0 or 1 (i.e. $anything**0==1 but 0*$anything==0)

    0**0 (in perl) equals 0^0 (in exponent notation) equals 1

    Any number computed to the exponent of 0 is 1. Perl behaves this way.

    if (eval(0**0)){print "JAPH\n";}

    The math article noted would seem to support that assertion as well. While there are speculative comments to the contrary towards the beginning of the article, the citations noted in following instead support this idea again.

    How is this ugly? It seems to be clearly defined. Is that the issue? Would you prefer to be able to configure it depending on the job? Is this like trying to ban guns to keep people from shooting themselves in the foot or are we offering them telescopic sighting mechanisms so they can shoot only the offending toe?



    Wait! This isn't a Parachute, this is a Backpack!
      It is ugly because it is ambiguous, convention not withstanding. You can artifically declare one interpretation to be the preferred one, but it will still be artificial. Here's a program for you to run...
      #!/usr/bin/perl -w print "\n n| n^0.1 n^0.01 n^0.001 etc...\n"; print ("--+".("-" x 70)."\n"); for my $num (reverse 0..10) { printf "%2d| ", $num; for my $exp (1..10) { printf "%5.4f ", $num ** (10**(-$exp)); } print "\n"; }
      Notice any tendencies? Is the case for zero different in any way? Explain.
      n| n^0.1 n^0.01 n^0.001 etc... --+------------------------------------------------------------------ 10| 1.2589 1.0233 1.0023 1.0002 1.0000 1.0000 1.0000 1.0000 1.0000 9| 1.2457 1.0222 1.0022 1.0002 1.0000 1.0000 1.0000 1.0000 1.0000 8| 1.2311 1.0210 1.0021 1.0002 1.0000 1.0000 1.0000 1.0000 1.0000 7| 1.2148 1.0196 1.0019 1.0002 1.0000 1.0000 1.0000 1.0000 1.0000 6| 1.1962 1.0181 1.0018 1.0002 1.0000 1.0000 1.0000 1.0000 1.0000 5| 1.1746 1.0162 1.0016 1.0002 1.0000 1.0000 1.0000 1.0000 1.0000 4| 1.1487 1.0140 1.0014 1.0001 1.0000 1.0000 1.0000 1.0000 1.0000 3| 1.1161 1.0110 1.0011 1.0001 1.0000 1.0000 1.0000 1.0000 1.0000 2| 1.0718 1.0070 1.0007 1.0001 1.0000 1.0000 1.0000 1.0000 1.0000 1| 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 0| 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000