코테파이썬에서 import math해서 편하게 사용할 수 있는 것들을 정리했다.
print( 0.1 + 0.2 == 0.3 )
import math
print(math.isclose(0.1 + 0.2, 0.3))
print(math.ceil(3.14))
print(math.floor(3.14))
print(round(3.14))
print(math.sqrt(100))
print(math.sqrt(7))
print(math.sqrt(math.pi))
내장함수가 따로 있다.
from fractions import Fraction
number1 = 1/3 # 1/2를 저장한다.
number2 = Fraction(1,3)
print(number1 == number2) # 당연히 다르다.
positive = math.inf
negative = -math.inf