파이썬 math.log1p() 메서드
예시
다른 숫자에 대한 로그(1+숫자) 찾기
# Import math Library
import math
# Return the log(1+number) for different numbers
print(math.log1p(2.7183))
print(math.log1p(2))
print(math.log1p(1))
정의 및 사용
이 math.log1p()
메서드는 number 값이 0에 가까울 때도 정확한 방식으로 계산된 log(1+숫자)를 반환합니다.
통사론
math.log1p(x)
매개변수 값
Parameter | Description |
---|---|
x | Required. Specifies the number to process. If the value is a negative number, it returns a ValueError. If the value is not a number, it returns a TypeError |
기술적 세부 사항
반환 값: | 1+ 숫자float 의 로그 값을 나타내는 값 |
---|---|
파이썬 버전: | 2.6 |