Should I redefine 0^0


I've found some times, while playing with combinatorics, that Mathematica can't calculate some functions because $0^0$ is not defined as $1$.

(I know that some people think that $0^0$ should be left undefined. I'm convinced that $0^0$ should be defined as $1$ and this question doesn't intend to open a discussion of that).

My question is this:

If I redefine $0^0$ as $1$ in Mathematica like this:


could I be breaking some internal algorithms of Mathematica?

I did redefined FactorInteger[1] as {} a while ago (and that help me to simplify many function definitions) and I haven't find any issues as a result of that, but I'm afraid that messing with Power could be more delicate.


Posted 2021-01-20T20:13:25.807

Reputation: 251

Question was closed 2021-01-21T05:49:20.320

This has come up before, here and here. Mr. Wizard's solution in the second link seems like an elegant solution. Any function you want to define, where 0^0 should be 1, define using Internel`InheritedBlock, and the change will be localized.

– Jason B. – 2021-01-20T20:18:55.510

2MichaelJacksonEatingPopcorn.gif – Chris K – 2021-01-20T20:19:21.977

2"...could I be breaking some internal algorithms of Mathematica?" - Yes. Generally speaking, if you ever make a modification to something as basic as an arithmetic operation, anything that breaks afterwards is more than likely your fault. Why not reformulate your combinatorial formulae so that computing 0^0 is avoided? Otherwise, define a custom function like myPower = If[#2 == 0, 1, #1^#2] & and use that instead. – J. M.'s ennui – 2021-01-21T03:36:03.323

No answers