```
def pow(self, x, n):
if n == 0:
return 1
if x == 0 and n < 0:
return
result = 1
if n > 0:
while n > 0:
pre_result = result
result *= x
if pre_result == result or pre_result == -result:
if result >= 0:
return result
if n % 2 == 0:
return -result
else:
return result
n -= 1
return result
else:
while n < 0:
pre_result = result
result /= x
if pre_result == result or pre_result == -result:
if result >= 0:
return result
if n % 2 == 0:
return -result
else:
return result
n += 1
return result
```

my code is like the above.

it has time limited error with the test case:

-1.00000, -2147483648

but I think for my solution, it should be very quick and I tested in my computer, it will take less than 1 ms,

what's wrong with my solution?

Thank you very much!