Reputation: 71
When using the following function, I sometimes get NAN
returned for some inputs; I think I'm getting NAN
when I'm using negative values for the variables. How can I fix this?
pow(($LY/$FY),(1/10)) - 1
Upvotes: 0
Views: 899
Reputation: 324680
Add a check beforehand to ensure that $LY/$FY
is positive. Alternatively, depending on what you're using it for, use the abs()
function on that fraction to change negative numbers to positive ones.
Upvotes: 2