3 ms·
You're right, there does not appear to be a way to achieve 1. Rust arithmetic does 3. in debug builds, or something vaguely similar if requested by using the c
by the_why_of_y 10y ago
You're right, there does not appear to be a way to achieve 1.
Rust arithmetic does 3. in debug builds, or something vaguely similar if requested by using the checked_* functions, and 2. in release builds, or if requested by using the wrapping_* functions, and 4. by using the saturating_* functions.
Recommended reading:
http://huonw.github.io/blog/2016/04/myths-and-legends-about-integer-overflow-in-rust/ http://huonw.github.io/blog/2016/04/myths-and-legends-about-...