Exponentiation operator: Difference between revisions

Content added Content deleted
(Undo revision 285660 by Xbello (talk))
Line 1,745: Line 1,745:
echo "2.71^6 = ", 2.71^6
echo "2.71^6 = ", 2.71^6
echo "2.71^-6 = ", 2.71 ^ -6</lang>
echo "2.71^-6 = ", 2.71 ^ -6</lang>

Only for positive natural exponents:

import math
doAssert 2^6 == 64

For negative and/or float exponents:

import math
doAssert $pow(2, -1.5) == "0.3535533905932738"


=={{header|Objeck}}==
=={{header|Objeck}}==