Since any number raised to the 0 power is equal to 1, 0 raised to the 0 power is also equal to 1, so the Math.pow(0, 0) expression is legal. Of course, 0 raised to the 0 power has no real meaning to us, but it is technically a valid mathematical expression (unlike division by 0, for example). I hope this answers your question.
Why is Math.pow(0, 0) === 1?
Javascript says that: Math.pow(0, 0) === 1 // true and C++ says the same thing: pow(0, 0) == 1 // true Why does `Math.pow(0, 0)` throw no errors?
Follow
2
Add comment
More
Report
1 Expert Answer
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.