-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
powc of zero returns nan #114
Comments
Ouch, that's a big oversight. This probably comes from the implementation's |
Yes I was also suspecting the ln as well. It seems that C does just a check for zero and uses a similar formula: https://github.com/eblot/newlib/blob/2a63fa0fd26ffb6603f69d9e369e944fe449c246/newlib/libm/complex/cpowf.c#L47 I'm currently using a workaround for this:
which does exactly this and it seems to be fine for me (but should rather use the abs of the complex number, though). |
116: Fixes nan value for powc of zero r=cuviper a=domna Fixes #114 `@cuviper` I just added a check for zero here as I suggested in #114. Co-authored-by: domna <[email protected]> Co-authored-by: Florian Dobener <[email protected]> Co-authored-by: Josh Stone <[email protected]>
When I execute the following line
I get nan as the output.
Shouldn't this be zero instead of nan?
The text was updated successfully, but these errors were encountered: