我正在玩**
运算符,并注意到:
0**0 == 1
和
pow(0, 0) == 1
甚至math
:
math.pow(0, 0) == 1
Google ! (搜索0**0
)
为什么会这样?据我所知,0 ** 0未定义
答案 0 :(得分:5)
不,你错了。它可以正常工作。
n/0
未定义。 0**0
1
是0
,因为1
提升的任何数字都是{{1}}。
以下是一些参考资料:
http://mathforum.org/dr.math/faq/faq.number.to.0power.html
https://en.wikipedia.org/wiki/Exponentiation#Zero_to_the_power_of_zero
答案 1 :(得分:0)
根据定义,对功率0的任何内容都是1。
答案 2 :(得分:0)
由于数学规则。 0次方的所有东西都是1。