-
Notifications
You must be signed in to change notification settings - Fork 192
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
BigUint should have count_ones() and similar methods #174
Comments
The iterators in #158 will at least let you do that without creating a temporary A harder question is whether we should do anything for RE: "and similar methods": For |
It's not true for |
@tczajka Ah, you're right, of course. We can still do |
I think leaving Should I'll try to get a PR together. Thanks much! |
I feel like |
Any simple implementation of The obvious plan is to depend on dtolnay's |
I gave a comment on the PR about |
Sounds good, thanks. |
Thanks for merging #175 ! |
I needed
BigUint::count_ones()
for a project, so I implemented it in terms ofto_u32_digits()
.But now I'm relying on the optimizer to clean up my code, plus the implementation should probably return
u64
because it's pretty easily possible to have more than 4 billion ones in aBigUint
so it's buggy. :-)I'd be happy to put together some kind of pull request if there's some interest in one.
The text was updated successfully, but these errors were encountered: