You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.
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 yetsaturate
), division/remainder can panic when dividing by zero. I don't want to have different semantics from the original wrapping methods, andsaturate
is more complex and likely slower.The text was updated successfully, but these errors were encountered: