Skip to content
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

Some functions don't handle inifinities and nans #17

Closed
GoogleCodeExporter opened this issue May 5, 2015 · 3 comments
Closed

Some functions don't handle inifinities and nans #17

GoogleCodeExporter opened this issue May 5, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

Powers, in particular, lack correct handling of special numbers.

Original issue reported on code.google.com by fredrik....@gmail.com on 16 Feb 2008 at 12:20

@GoogleCodeExporter
Copy link
Author

>>> for f in [lambda x: nthroot(x, 3), sqrt, cos, log, atan, cosh]:
...   print f(mpf('inf'))
...   print f(mpf('nan'))
...
+inf
nan
+inf
nan
nan
nan
+inf
nan
1.5707963267949
nan
+inf
nan
>>> mpf('nan')**2
mpf('nan')
>>> mpf('inf')**2
mpf('+inf')

Are there still some functions left?

Original comment by Vinzent.Steinberg@gmail.com on 9 Oct 2008 at 2:33

@GoogleCodeExporter
Copy link
Author

Yes, plenty.

>>> acosh(nan)
mpc(real='0.0', imag='nan')

>>> hyp2f1(nan,nan,nan,nan)
(infinite recursion)

Original comment by fredrik....@gmail.com on 9 Oct 2008 at 3:26

@GoogleCodeExporter
Copy link
Author

There are still some functions that will crash or return strange things at 
infs/nans, but the situation is much better, and there are lots of tests.

Original comment by fredrik....@gmail.com on 14 Jun 2010 at 7:51

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant