Here is the code:
exp = 1.79
def calc(t):
return pow(t - 1, exp)
The input values of t range from 0 to 1 (e.g. 0.04). This code throws a “math domain exception,” but I’m not sure why.
How can I solve this?
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.
If
tranges from 0 to 1, thent - 1ranges from -1 to 0. Negative numbers cannot be raised to a fractional power, neither bypowbuiltin normath.pow.