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

DONT_PANIC? #11

Open
llogiq opened this issue Jul 3, 2016 · 2 comments
Open

DONT_PANIC? #11

llogiq opened this issue Jul 3, 2016 · 2 comments

Comments

@llogiq
Copy link
Owner

llogiq commented Jul 3, 2016

I wonder if overflower should have a mode that avoids panics distinct from wrap/saturate to do whatever on overflow (e.g. return 0) but avoid panic.

The rationale is that even with wrap (and as of yet saturate), division/remainder can panic when dividing by zero. I don't want to have different semantics from the original wrapping methods, and saturate is more complex and likely slower.

@kevincox
Copy link

It would also be great to have a mode where overflow is undefined behavior. It is quite rare that wrapping where someone didn't expect it will fix a bug so for release builds it would be nice to get some extra performance.

@llogiq
Copy link
Owner Author

llogiq commented Oct 31, 2016

Agreed, this is something I would like to see. However it would require linking LLVM intrinsics not currently available in Rust, and I lack the time to maintain it.

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

No branches or pull requests

2 participants