๐Ÿ“‚์›น ๊ฐœ๋ฐœ(Web)/๐ŸํŒŒ์ด์ฌ(Python)

ํŒŒ์ด์ฌ ํ‘œ์ค€ ๋ชจ๋“ˆ

๐Ÿ‘ฉ‍๐ŸŽ“์ธํ…”๋ฆฌ๊ฐ์ž๐Ÿฅ” 2023. 2. 1. 17:05

ํ‘œ์ค€๋ชจ๋“ˆ
    ํŒŒ์ด์ฌ์—์„œ ๊ธฐ๋ณธ์ ์œผ๋กœ ์‹ค์น˜๋˜์–ด ์žˆ๋Š” ๋ชจ๋“ˆ

# math - ์ˆ˜ํ•™ ๊ด€๋ จ ๋ชจ๋“ˆ
import math

1. ์›์ฃผ์œจ
print(math.pi)


2. ์˜ฌ๋ฆผ
print(math.ceil(1.1))


3. ๋‚ด๋ฆผ
print(math.floor(1.9))


4. ์ •์ˆ˜๋กœ ์ ˆ์‚ญ
print(math.trunc(1.9)) #์ ˆ์‚ญ


print(math.floor(1.9)) #๋‚ด๋ฆผ


print(math.ceil(1.9)) #์˜ฌ๋ฆผ


5. ์ œ๊ณฑ๊ทผ
print(math.sqrt(25))


6. ์ œ๊ณฑ
print(math.pow(2, 3))