반응형
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
- 파이썬
- GIT
- google apps script
- PostgreSQL
- Google Spreadsheet
- numpy
- Tkinter
- SQL
- Mac
- Github
- Excel
- Java
- array
- PySpark
- c#
- matplotlib
- Redshift
- Kotlin
- hive
- Google Excel
- gas
- string
- Apache
- PANDAS
- dataframe
- django
- Python
- list
- math
Archives
- Today
- Total
달나라 노트
Python math : pow() (거듭제곱, power) 본문
728x90
반응형
math library의 pow() method는 거듭제곱의 결과를 return합니다.
Syntax
math.pow(x, y)
x, y는 숫자입니다.
pow() method는 x^y 의 결과를 return합니다.
예시를 봅시다.
import math
print(math.pow(2, 3))
print(math.pow(10, 4))
-- Result
8.0
10000.0
- math.pow(2, 3)
2^3의 결과는 8이므로 8이 return됩니다.
- math.pow(10, 4)
10^4의 결과는 10000이므로 10000이 return됩니다.
return값을 보면 8.0, 10000.0으로 모두 float type으로 return됩니다.
728x90
반응형
'Python > Python math' 카테고리의 다른 글
Python math : factorial() (!, factorial, 팩토리얼) (0) | 2022.11.08 |
---|---|
Python math : sqrt() (제곱근) (0) | 2022.11.08 |
Python math : fmod() (나머지, 나머지 구하기, remainder) (0) | 2022.11.08 |
Python math : fabs (절대값) (0) | 2022.11.08 |
Python math : log, log2, log10 (python log 함수, python ln, 자연로그, numpy.log, numpy.log2, numpy.log10) (0) | 2022.01.16 |
Comments