1 개요
- power
- pow
- **
- Returns base raised to the power of exp.
- test set
- power(2, -3) → 0.125
- power(3, 4) → 81
2 C

C
Copy
#include <stdio.h>
#include <math.h>
int main() {
printf("%f\n", pow(2,-3));
// 0.125000
printf("%f\n", pow(3,4));
// 81.000000
printf("%d\n", (int)pow(3,4));
// 81
}
3 Excel
PHP
Copy
=POWER(2,-3)
// 0.125
=POWER(3,4)
// 81
4 Java

Java
Copy
public class MyClass {
public static void main(String args[]) {
System.out.println( Math.pow(2, -3) ); // 0.125
System.out.println( Math.pow(3, 0) ); // 1.0
System.out.println( Math.pow(3, 1) ); // 3.0
System.out.println( Math.pow(3, 2) ); // 9.0
System.out.println( Math.pow(3, 4) ); // 81.0
}
}
5 JavaScript
JavaScript
Copy
console.log( Math.pow(3,2) ); // 9
6 Perl
Perl
Copy
print 2**-3;
# 0.125
print 3**4;
# 81
7 PHP

PHP
Copy
var_dump( pow(2, -3) );
# float(0.125)
var_dump( pow(3, 4) );
# int(81)
8 Python
Python
Copy
print(2**-3)
# 0.125
print(3**4)
# 81
Python
Copy
print(pow(2,-3))
# 0.125
print(pow(3,4))
# 81
9 SQLite
SQLite
Copy
SELECT 2 << 3;
Loading
SQLite
Copy
SELECT 3*3*3*3;
Loading
10 Ruby
Ruby
Copy
puts 2**-3
# 1/8
puts 3**4
# 81
11 같이 보기
로그인하시면 댓글을 쓸 수 있습니다.
리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― …리눅스 Python 2.7 컴파일 설치 ― Jmnote리눅스 Python 2.7 컴파일 설치 ― ㅇㅇㅇ미운코딩새끼 ― 승호 도령미운코딩새끼 ― 불탄고등어미운코딩새끼 ― 김레이미운코딩새끼 ― 호박이미운코딩새끼 ― Junhg0211미운코딩새끼 ― 김왼손미운코딩새끼 ― 용딘이미운코딩새끼 ―Pinkcrimson
유기농냠냠파이썬 ― 호박유기농냠냠파이썬 ― 이에스유기농냠냠파이썬 ― 이승현파이썬 global ― Jmnote파이썬 global ― John Jeong파이썬 global ― Jmnote파이썬 global ― John Jeong파이썬 global ― John Jeong파이썬 global ― John Jeong파이썬 global ― Jmnote파이썬 global ― John Jeong