pow()

설명

숫자 거듭제곱 값 계산. pow() 는 숫자를 분수 제곱하는 데 쓸 수 있다. 이것은 곡선의 지수 매핑을 생성할 때 쓸모 있다.

문법

pow(base, exponent)

매개변수

  • base: 숫자 (float)
  • exponent: base 를 거듭 곱할 횟수 (float)

반환값

  • 거듭제곱 결과. (double)

예제 코드

void setup() { Serial.begin(9600); int x = 2; int y = 3; double z = pow(x, y); Serial.print(x); Serial.print(" raised to the power of "); Serial.print(y); Serial.print(" is "); Serial.println(z); } void loop() {}

The result in Serial Monitor:

COM6
Send
2 raised to the power of 3 is 8.00
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

코드 라이브러리에서 (fscale) 함수를 보세요.

더보기

ARDUINO BUY RECOMMENDATION

Arduino UNO R3
Arduino Starter Kit
Please note: These are affiliate links. If you buy the components through these links, We may get a commission at no extra cost to you. We appreciate it.

※ OUR MESSAGES

  • We are AVAILABLE for HIRE. See how to hire us to build your project
  • Any suggestion, correction, and translation? please email us at ArduinoGetStarted@gmail.com, We appreciate it
  • We mainly keep improving the references in English. See English version of this page for the latest update.