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

How to implement signed over- / underflow for Int? #1

Open
jplatte opened this issue Jun 15, 2019 · 1 comment
Open

How to implement signed over- / underflow for Int? #1

jplatte opened this issue Jun 15, 2019 · 1 comment
Labels
enhancement New feature or request experimentation Something to experiment with

Comments

@jplatte
Copy link
Member

jplatte commented Jun 15, 2019

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 jplatte changed the title How to implement signed over- / underflow for Int in release mode? How to implement signed over- / underflow for Int? Jun 18, 2019
@jplatte
Copy link
Member Author

jplatte commented Jun 18, 2019

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

@jplatte jplatte added enhancement New feature or request experimentation Something to experiment with labels Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request experimentation Something to experiment with
Development

No branches or pull requests

1 participant