+ 1

# Math.pow

Hey guys, please help me with the Math.pow class double p = Math.pow(2, 3); // 8.0 I donât understand to calculate this. Thank you!

7 Answers

+ 4

Yes, exactly

+ 3

Math.pow(a,b);
aÂ - the base.
bÂ - the exponent.
Returns:the valueÂ a^b

+ 3

2^3 it is actually equals 2*2*2

+ 3

Frank Seltmann you're welcome đ. Happy learning.

+ 2

ahh, now I understand
so it means
double p = Math.pow(2, 4); // 16.0
2*2=4
4*2=8
8*2=16
correct?

+ 2

wonderful, thanks a lot for your support Michal!

+ 1

the value a^b or the value of a*a*a?