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

does not handle sizes that cross boundaries #4

Open
bmoscon opened this issue Mar 23, 2013 · 0 comments
Open

does not handle sizes that cross boundaries #4

bmoscon opened this issue Mar 23, 2013 · 0 comments
Assignees
Labels

Comments

@bmoscon
Copy link
Owner

bmoscon commented Mar 23, 2013

If a combination of # of elements, # of bits, and underlying datatype cross boundaries, the array will fail to properly contain the last element.

for example, if you set the number of bits to 10, and use 7 elements(using a uint64_t datatype), this requires 70 total bits, which is not a multiple or factor of 64, Bit array is not smart enough to use the last 4 bits of the previous uint64_t element, so if you set the last element to 1024, only the last 6 bits will be set, since it is unable to set the previous 4 bits in the previous uint64_t. For now, just disallowing bit sizes that are not factors of the datatype.

@ghost ghost assigned bmoscon Mar 23, 2013
@bmoscon bmoscon mentioned this issue Mar 23, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant