Getting "ValueError: math domain error" in math.pow()

119 Views Asked by At

I'm getting

ValueError: math domain error

while running code like the one below (I simplified it):

import math
def f(x):
    return math.pow(x, -4)

for i in range(10):
    print(f(i))

Also, I checked type of arguments by

for i in range(10):
    print(type(i))

Type of i is exactly integer.

0

There are 0 best solutions below