Power (Math.Pow(a, b))
The power function
what does the power function do? The Math.Pow() function takes two number variables, a and b, and raises a to the power of b.
how do we use the Math.Pow() function?
The method for using the function is:
Math.Pow(a, b);
"Math" is the library the function is a part of.
"a" and "b" refers to the variables needed to run the function.
Example:
float x = Math.Pow(2, 3);
this line would declare the variable "x" and give it the value 8.
Last updated
Was this helpful?