Decimals and other numbers

Devin Jeanpierre jeanpierreda at
Sat Jan 10 02:25:38 CET 2015

On Fri, Jan 9, 2015 at 2:20 AM, Steven D'Aprano
<steve+comp.lang.python at> wrote:
> I don't understand what you're trying to say here. You can't just
> arbitrarily declare that 0**1 equals something other than 0 (or for that
> matter, doesn't equal anything at all).

You can, actually. It's just silly. (Similarly, you can declare that
0**0 is something other than 1 (or for that matter, doesn't equal
anything at all), but it's silly.)

> Can we agree that 0**1 is well-defined and get back to 0**0?

Believe it or not I actually misread your whole thing and thought we
were talking about 0**0. Otherwise I would've been much briefer...

>>> Not quite. I agree that, *generally speaking* having 0**0 equal 1 is the
>>> right answer, or at least *a* right answer, but not always. It depends on
>>> how you get to 0**0...
>> You don't "get to" a number. Those are limits. Limits and arithmetic
>> are different.
>> (Well, sort of. :)
> Yes, sort of :-)

I was alluding to the definition of the reals.

> Of course you can "get to" numbers. We start with counting, that's a way
> to "get to" the natural numbers, by applying the "successor" function
> repeatedly until we reach the one we want. Or you can "get to" pi by
> generating an infinite sequence of closer and closer approximations. Or an
> infinite series. Or an infinite product. Or an infinite continued fraction.
> All of these "ways to get to pi" converge on the same result.

Yes, all numbers can be represented as a converging limit. However,
that does not mean that the way you compute the result of a function
like x**y is by taking the limit as its arguments approach the input:
that procedure works only for continuous functions. x**y is not
continuous at 0, so this style of computation cannot give you an

> If 0**0 has a value, we can give that number a name. Let's call it Q. There
> are different ways to evaluate Q:
> lim x -> 0 of sin(x)/x  gives 1
> lim x -> 0 of x**0  gives 1
> lim x -> 0 of 0**x  gives 0

This is a proof that f(x, y) = x**y is not continuous around 0, 0. It
is not a proof that it is undefined at 0, 0, in fact, it says nothing
about the value.

> 0**0 = 0**(5-5) = 0**5 / 0**5 = 0/0  gives indeterminate

Here is a nearly identical "proof" that 0**1 is "indeterminate": 0 =
0**1 = 0**(5 - 4) = 0**5 / 0**4 = 0/0 gives indeterminate.

The fact that you can construct a nonsensical expression from an
expression doesn't mean the original expression was nonsensical. In
this case, your proof was invalid, because 0**(X-Y) is not equivalent
to 0**X/0**Y.

> So we have a problem. Since all these "ways to get to Q" fail to converge,
> the obvious answer is to declare that Q doesn't exist and that 0**0 is
> indeterminate, and that is what many mathematicians do:

That isn't what "indeterminate" means.

> However, this begs the question of what we mean by 0**0.
> In the case of m**n, with both m and n positive integers, there is an
> intuitively obvious definition for exponentiation: repeated multiplication.
> But there's no obvious meaning for exponentiation when both m and n are
> zero, hence we (meaning, mathematicians) have to define what it means. So
> long as that definition doesn't lead to contradiction, we can make any
> choice we like.

Sorry, I don't follow. n**0 as repeated multiplication makes perfect
sense: we don't perform any multiplications, but if we did, we'd be
multiplying 'n's. 0**m as repeated multiplication makes perfect sense:
whatever we multiply, it's a bunch of 0s. Why doesn't 0**0 make sense?
We don't perform any multiplications, but if we did, we'd be
multiplying 0s.

If we don't perform any multiplications, the things we didn't multiply
don't matter. Whether they are fives, sevens, or zeroes, the answer is
the same: 1.

>>> Since you can get difference results depending on the method you use to
>>> calculate it, the "technically correct" result is that 0**0 is
>>> indeterminate.
>> No, only limits are indeterminate. Calculations not involving limits
>> cannot be indeterminate.
> Do tell me what 0/0 equals, if it is not indeterminate.

0/0 is undefined, it isn't "indeterminate".

Indeterminate forms are a way of expressing limits where you have
performed a lossy substitution. That is: "the limit as x approaches a
of 0/0" is an indeterminate form.

>> In the real number system, infinity does not exist. It only exists in
>> limits or extended number systems.
> Yes, you are technically correct, the best kind of correct.
> I'm just sketching an informal proof. If you want to make it vigorous by
> using limits, be my guest. It doesn't change the conclusion.

No, the point is that limits are irrelevant.

As has been proven countlessly many times, x**y is not continuous
around the origin. This has no bearing on whether it takes a value at
the origin.

> [...]
>>> Arguably, *integer* 0**0 could be zero, on the basis that you can't take
>>> limits of integer-valued quantities, and zero times itself zero times
>>> surely has to be zero.
>> No. No no no. On natural numbers no other thing makes sense than 1.
> On the basis that m**n means m multiplied by itself n times:
> 5**4 = 5*5*5*5 = 625
> that gives us:
> 0**0 = zero multiplied by itself zero times.
> You can multiply 0 by any number you like, and the answer will always be 0,
> not 1. Even if that other number is 0, the answer is still 0.

If you are performing no multiplications, you never multiplied 0 by
any number at all, so what you get from 0*X is irrelevant.

-- Devin

More information about the Python-list mailing list