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

add a hybrid unbounded integer type to the stdlib #8635

Closed
thestinger opened this issue Aug 20, 2013 · 3 comments
Closed

add a hybrid unbounded integer type to the stdlib #8635

thestinger opened this issue Aug 20, 2013 · 3 comments

Comments

@thestinger
Copy link
Contributor

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.

@alexcrichton
Copy link
Member

This might belong better in libextra instead of libstd. Plus there's already a bigint in there which could be used for the "extra large" integers for this.

@thestinger
Copy link
Contributor Author

Blocked by #11536.

@thestinger
Copy link
Contributor Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants