-
Notifications
You must be signed in to change notification settings - Fork 112
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
count_ones() gives wrong result for BitSlice #7
Comments
Hi! Thanks so much for your report. The bug here is pretty embarrassing in how it got overlooked. The diff here is just inserting the correct I've published |
@geq1t, I've been looking through the git history of this bug and I want to take a minute to say how extremely thankful I am not only for opening this issue but for the information you provided. The test case you gave reproduced, and your sentence,
Told me exactly what the error was while I was reading the email, before I'd even opened my editor. This was a great report; thanks for using |
Thanks for fixing this so quickly! I'm glad the bug report was useful. I'll give it a try again next week, but other duties call right now. |
Using bitvec 0.10, counting 1 bits in a bit slice within a single storage unit returns the total number of bits within the slice, not the number of 1 bits. Interestingly, it does work across when operating across byte boundaries. The following program:
returns the following output
The text was updated successfully, but these errors were encountered: