I have this problem
>>> import math
>>> math.pow(-1.07,1.3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: math domain error
any suggestion ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
(-1.07)1.3 will not be a real number, thus the Math domain error.
If you need a complex number, ab must be rewritten into eb ln a, e.g.
If you just want to return NaN, catch that exception.
BTW, in Python usually the built-in
a ** bis used for raising power, notmath.pow(a, b).