使用math.pow或**运算符哪个更有效?我什么时候应该用一个而另一个呢?
math.pow
**
到目前为止,我知道x**y可以返回int或float,如果使用十进制函数,则pow函数将返回浮点数。
x**y
int
float
pow
import math print( math.pow(10, 2) ) print( 10. ** 2 )
https://stackoverflow.com/questions/20969773
相似问题