0
About exponentiation
how does it work, I don't know
1 Odpowiedź
+ 1
Lets refer back to math basics.
What is an exponent in laymants terms?
For whole numbers, it's how many times you will repeatedly multiply the number.
Example:
5 ^ 2 = 5 * 5 = 25
2 ^ 4 = 2 * 2 * 2 * 2 = 16
Where ^ is to the exponent of, and * is to multiply.
Decimals get a bit trickier, ignore them for now.
Example:
4 ^ (1/2) = 2.
So, in python you use x**a to take x to the exponent of a.
so:
2 ** 4 = 2 * 2 * 2 * 2 = 16
Or
5 ** 2 = 5 * 5 = 25