-
Notifications
You must be signed in to change notification settings - Fork 227
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
powm1(0.0, -2.0) doesn't throw an exception. Should it? #781
Comments
I think the behavior is correct. If you compare to the error handling of |
OK, I'm still figuring out the conventions followed by the functions in Boost/Math/Special Functions. Based on the policy docs, I thought the default behavior would be to throw a I see that On the other hand, |
@WarrenWeckesser : Lol, I like that rule. Personally I find it preferable to use all the semantic space that IEEE floats gives us and like the |
It's a bug, but I'm not sure in which direction: wolframalpha reports 0^-2 as complex-infinity which would be a domain error, but if we treat it as 1/0^2 then it should be a straight overflow error. |
Makes 0^-n an overflow error (which matches std::pow which returns +INF rather than a NaN). Fixes boostorg#781.
Here's a test program that I compiled with the
develop
branch:I expected
powm1(0.0, -2.0)
to throw an exception, but it does not; the program outputsp = inf
. Should it throw an exception?The text was updated successfully, but these errors were encountered: