-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
document left and right bitshift for BitVector
#21627
Conversation
LGTM, thanks! (and thanks Alex for the cleanup) should be squashed on merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As >>>
is also defined for BitVector
, maybe you could document it in this PR?
Otherwise looks good!
Right bit shift operator, `B >> n`. For `n >= 0`, the result is `B` | ||
with elements shifted `n` positions forward, filling with `false` | ||
values. If `n < 0`, elements are shifted backwards. Equivalent to | ||
`B << -n`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest "If n < 0
, this is equivalent to B << -n
, i.e. elements are shifted backwards".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote it this way because if n
is positive or negative, B >> n
is equivalent to B << -n
. Hence the separate statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, makes sense.
Yup good point, I'll add docs for unsigned shift. |
Documentation added for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @nsmith5!
Thanks! |
Thanks for your help everyone. This has been one of my first contributions and you made it a good experience. |
Fixes #19767 and fixes #20788. Documents
<<
and>>
for theBitVector
type with examples.