14 lines
162 B
Text
14 lines
162 B
Text
|
|
func mypow n exp .
|
||
|
|
r = 1
|
||
|
|
if exp < 0
|
||
|
|
exp = -exp
|
||
|
|
n = 1 / n
|
||
|
|
.
|
||
|
|
for i to exp
|
||
|
|
r *= n
|
||
|
|
.
|
||
|
|
return r
|
||
|
|
.
|
||
|
|
print mypow pi 2
|
||
|
|
print mypow 2 -2
|