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