Python log function

log(x[,base=e]) function returns the logarith of x to the given base. It's a method of math module.

>>> import math
>>> math.log(2)
0.6931471805599452
>>> math.log(2,math.e)
0.6931471805599453
>>> math.log(2,4)
0.5


















endmemo.com © 2024  | Terms of Use | Privacy | Home