js_int icon indicating copy to clipboard operation
js_int copied to clipboard

How to implement signed over- / underflow for Int?

Open jplatte opened this issue 6 years ago • 1 comments

Rust specifies that, when debug assertions are disabled, signed integers over- and underflow. It have not found any documentation about whether bitmasks on negative integers are defined. If they are defined, this is (probably) easy to implement. Otherwise, any implementation would (probably) not be much faster than just having range-check assertions in both debug and release mode.

jplatte avatar Jun 15 '19 19:06 jplatte

Also relevant for non-release builds if we want to implement wrapping_* and overflowing_* methods for Int.

jplatte avatar Jun 18 '19 09:06 jplatte