Skip to content

Bitwise operations with different lengths #3

Description

@Imberflur

These operations:

    impl_operation!(and, and_cloned, and_inplace, &);
    impl_operation!(or, or_cloned, or_inplace, |);
    impl_operation!(xor, xor_cloned, xor_inplace, ^);

all assert that the number of bits is the same on both sides:

assert_eq!(self.nbits, other.nbits);

However, for my use case (specifically using or_inplace) the number of bits may sometimes be different so it would be useful to have a set of operations that doesn't make this assertion. Afaict there is also no interface for the user to iterate the storage elements and perform this operation manually.

Additionally, it would be useful to document this panic in the function docs for each of these existing methods.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions