PythonNumbermath.log

Returns the natural logarithm, or logarithm to a given base.

문법

math.log(x, base?)

예제

아래 값을 입력하면 예제에 즉시 반영됩니다.

import
math
print
import math
print(math.log(math.e))   # 1.0
print(math.log(8, 2))     # 3.0