-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
add a hybrid unbounded integer type to the stdlib #8635
Comments
This might belong better in libextra instead of libstd. Plus there's already a |
Blocked by #11536. |
I don't think we should include big integers in the standard library if it's not a competitive implementation. As the only realistic option is GMP and it isn't viewed as acceptable, I no longer want to do this. |
flip1995
pushed a commit
to flip1995/rust
that referenced
this issue
Apr 7, 2022
Add a lint to detect cast to unsigned for abs() and suggest unsigned_… …abs() changelog: Add a [`cast_abs_to_unsigned`] that checks for uses of `abs()` that are cast to the corresponding unsigned integer type and suggest to replace them with `unsigned_abs()`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would use the checked overflow traits to expand the representation to a big integer on overflow. It will be much slower than a bounded integer type, but not as slow as a big integer before overflow (but slower afterwards).
This is similar to an implementation of small vectors.
The text was updated successfully, but these errors were encountered: