Introduction
In this post, it will be seen how to calculate the value raised to a power. Basically, this function takes a number(base) and it raises to another number(exponent).Â
The function for calculating the value raised to a power using Arduino IDE is pow(). This function is used to raise a number to a certain exponent.
Â
Function
pow(base, exponent)
Parameters
base: the number (float)
exponent: the power to which the base is raised (float)
Example
float i=0; long result; void(setup){ Serial.begin(9600L); } void(loop){ Â Serial.println("Base 2: ");Â Â for(i=0;i<50;i++){ Â result=pow(2,i); Â Â Serial.println(result); }
How to calculate the value raised to a power with Arduino IDE