-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Tracking Issue for uint_bit_width
#142326
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
Comments
The name Not that I have any great suggestion for the bikeshed here. Maybe |
In other languages such as Python and C23, methods with the same purpose as this are named |
They most certainly can if they haven't used the |
The initial method name was derived from C23 and may be confusing to users unfamiliar with it. There may be more appropriate method name that is easier to understand for all users, including those who are not familiar with other languages such as Python and C23. |
For context,
|
…, r=tgross35 feat: Add `bit_width` for unsigned integer types - Accepted ACP: rust-lang/libs-team#598 - Tracking issue: rust-lang#142326 This PR adds methods to the primitive unsigned integer types that return the minimum number of bits required to represent an unsigned integer.
…, r=tgross35 feat: Add `bit_width` for unsigned integer types - Accepted ACP: rust-lang/libs-team#598 - Tracking issue: rust-lang#142326 This PR adds methods to the primitive unsigned integer types that return the minimum number of bits required to represent an unsigned integer.
I think Sometimes people do just have to read the docs before using a function. |
…, r=tgross35 feat: Add `bit_width` for unsigned integer types - Accepted ACP: rust-lang/libs-team#598 - Tracking issue: rust-lang#142326 This PR adds methods to the primitive unsigned integer types that return the minimum number of bits required to represent an unsigned integer.
I’m not saying the “span from most significant 1 to least significant 1” reading is unreasonable, but it does seem niche to me so the name seems like a fine compromise. I haven’t used |
…, r=tgross35 feat: Add `bit_width` for unsigned integer types - Accepted ACP: rust-lang/libs-team#598 - Tracking issue: rust-lang#142326 This PR adds methods to the primitive unsigned integer types that return the minimum number of bits required to represent an unsigned integer.
Rollup merge of #142328 - sorairolake:feature/uint-bit-width, r=tgross35 feat: Add `bit_width` for unsigned integer types - Accepted ACP: rust-lang/libs-team#598 - Tracking issue: #142326 This PR adds methods to the primitive unsigned integer types that return the minimum number of bits required to represent an unsigned integer.
feat: Add `bit_width` for unsigned integer types - Accepted ACP: rust-lang/libs-team#598 - Tracking issue: rust-lang/rust#142326 This PR adds methods to the primitive unsigned integer types that return the minimum number of bits required to represent an unsigned integer.
Uh oh!
There was an error while loading. Please reload this page.
Feature gate:
#![feature(uint_bit_width)]
This is a tracking issue for methods that return the minimum number of bits required to represent an unsigned integer.
The methods are implemented for the primitive unsigned integer types.
Public API
Steps / History
(Remember to update the
S-tracking-*
label when checking boxes.){u8,u16,u32,u64,u128,usize}::bit_len
libs-team#598bit_width
for unsigned integer types #142328Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩
The text was updated successfully, but these errors were encountered: