반응형
Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- hive
- c#
- Tkinter
- Presto
- Kotlin
- gas
- Excel
- Redshift
- 파이썬
- matplotlib
- PostgreSQL
- Apache
- GIT
- google apps script
- array
- dataframe
- Google Spreadsheet
- numpy
- Github
- list
- Google Excel
- Java
- django
- PANDAS
- PySpark
- SQL
- math
- Python
- string
Archives
- Today
- Total
달나라 노트
Python math : sqrt() (제곱근) 본문
728x90
반응형
math library의 sqrt() method는 제곱근 값을 return합니다.
Syntax
math.sqrt(x)
x는 어떤 숫자입니다.
sqrt() method는 x의 제곱근 값을 return합니다.
예시를 봅시다.
import math
print(math.sqrt(16))
print(math.sqrt(64))
-- Result
4.0
8.0
- math.sqrt(16)
16의 제곱근은 4이므로 4가 return됩니다.
- math.sqrt(64)
64의 제곱근은 8이므로 8이 return됩니다.
return값을 보면 4.0, 8.0의 float type입니다.
sqrt() method는 float type의 값을 결과로 return합니다.
728x90
반응형
'Python > Python math' 카테고리의 다른 글
| Python math : modf() (실수의 정수부 소수부 분리) (0) | 2022.11.08 |
|---|---|
| Python math : factorial() (!, factorial, 팩토리얼) (0) | 2022.11.08 |
| Python math : pow() (거듭제곱, power) (0) | 2022.11.08 |
| Python math : fmod() (나머지, 나머지 구하기, remainder) (0) | 2022.11.08 |
| Python math : fabs (절대값) (0) | 2022.11.08 |
Comments
