-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
integer division by zero isn't caught #1974
Comments
The problem is in math: This line has undefined behavior:
I didn't realize it threw an exception outside of the |
Overload for int and check for zero in denominator? Do you know what it does throw? If so, you could catch
|
The internet is saying check for 0, so that's the fix I'll apply.
|
This issue was moved to stan-dev/math#321 |
Summary:
Integer divide by zero throws an uncaught exception.
Description:
Running this crashes RStan:
I'm reporting in Stan because in the command refactor, we'll be catching this in Stan itself.
Reproducible Steps:
See above.
Current Output:
Crashes with `Floating point exception: 8
Expected Output:
Informative error message.
Additional Information:
Originally reported by @davharris on RStan tracker in issue stan-dev/rstan#316
Current Version:
v2.10.0
The text was updated successfully, but these errors were encountered: