今天,我用math.log()函数得到了 4913 以 17 为底的对数。答案是 3,但是当我运行下面的代码时,我得到了 2.9999999999999996。
math.log()
1) 是因为math.log(x, b)的计算是log(x) / log(b)吗?
math.log(x, b)
log(x) / log(b)
2)是否有任何解决方案可以获得正确答案3?
import math print(math.log(4913,17))
python math
math ×1
python ×1