-
-
Notifications
You must be signed in to change notification settings - Fork 18
power
drewmccluskey edited this page Jan 14, 2019
·
5 revisions
Returns given number x
multiplied by itself n
-times
power(x, n)
Argument | Description |
---|---|
double x |
The number to multiply by itself |
double n |
How many times to multiply x by itself |
Returns: double
This function returns the number x
multiplied by itself n
-times. For example, power(5,2)
will multiply 5 by itself 2 times and return 25, which is the same as 5*5 = 25.
double value;
value = power(5, 3);
This code sets value
to 125.
double value;
value = power(-4, 2);
This code sets value
to 16.
double value;
value = power(10, -2);
This code sets value
to 0.01.
Back to number_functions