# How can I make Mathematica agree that 0^0 = 1? [duplicate]

Occasionally I encounter messages like

Power::indet: Indeterminate expression (0. + 0. I)^0 encountered.

(or just 0^0). I believe I can safely declare these to be 1 for all of my purposes. Is there a way to build this in?

• @MichaelE2 Oh I see thanks. Could not find that for some reason, I honestly tried searching for 0^0. Let us mark it as duplicate. Although I already learned from the answer below some additional possibilities, but still... – მამუკა ჯიბლაძე Jul 18 '17 at 5:14
• @m_goldberg The way it was before your edit looked nicer with all that color-coding, are there specific reasons why your version is better? – მამუკა ჯიბლაძე Jul 18 '17 at 5:38
• The formatting I applied to the error message is the formatting we have been using for such on this site for all the years I have been a member. The idea is that messages should be distinct from code. – m_goldberg Jul 18 '17 at 6:05
• @m_goldberg I see. Pity. I wonder if somebody could be asked to extend color coding to messages too. Besides, it is just a random choice of convention which ones should go with four spaces and which with >!, no? – მამუკა ჯიბლაძე Jul 18 '17 at 6:18
• Messages issued in Mathematica do not have color coding. Messages are are mixture of text and code. It is probably more trouble that it would be worth to try to get lexical scanner to distinguish what is text and what is code. – m_goldberg Jul 18 '17 at 7:11

Unprotect[Power];

You should add also the cases like Power[0.,0.]. When you want to clear your own definitions, Unprotect, Clear, Protect.