+ 2
how is the answer to this 512? (2 ** 3 ** 2)
Please help me understand the answer to this. I am a bit confused about raising another power.
3 ответов
+ 7
Hi Keston Shook
3**2 is the same thing as 3^2, which is the same thing as 3 × 3 = 9
Now 2 ^ 3 ^ 2 = 2 ^ 9
2 ^ 9 = 2×2×2×2×2×2×2×2×2 = 512!
+ 2
this is because you dont do (2**3) ** 2 witch will result in: 64.
you do 2 to the power of 3 to the power of 2. so 2 ** 9 or 2 to the power of 9.
because 2 ** 3 = 9. if you want the result of 64 do ((2**3)**2).
+ 2
Think of it as 2**(3**2)=2**9=512.
If you feel unsure of how an exponent expression will get evaluated, then simply add parentheses to positively tell the interpreter/compiler how you want it done.