Today, I used math.log()
function to get the logarithm of 4913 to the given base 17. The answer is 3, but when I ran the code below, I got 2.9999999999999996.
1) Is it because math.log(x, b)
's calculation is log(x) / log(b)
?
2) Is there any solution to get the correct answer 3?
import math
print(math.log(4913,17))