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

document left and right bitshift for BitVector #21627

Merged
merged 1 commit into from
Apr 29, 2017
Merged

document left and right bitshift for BitVector #21627

merged 1 commit into from
Apr 29, 2017

Conversation

nsmith5
Copy link
Contributor

@nsmith5 nsmith5 commented Apr 29, 2017

Fixes #19767 and fixes #20788. Documents << and >> for the BitVector type with examples.

@ararslan ararslan added the docs This change adds or pertains to documentation label Apr 29, 2017
@tkelman
Copy link
Contributor

tkelman commented Apr 29, 2017

LGTM, thanks! (and thanks Alex for the cleanup)

should be squashed on merge

Copy link
Member

@rfourquet rfourquet left a 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`.
Copy link
Member

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".

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, makes sense.

@nsmith5
Copy link
Contributor Author

nsmith5 commented Apr 29, 2017

Yup good point, I'll add docs for unsigned shift.

@nsmith5
Copy link
Contributor Author

nsmith5 commented Apr 29, 2017

Documentation added for >>> and commits squashed

Copy link
Member

@Sacha0 Sacha0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nsmith5!

@rfourquet rfourquet merged commit ba0fbe1 into JuliaLang:master Apr 29, 2017
@rfourquet
Copy link
Member

Thanks!

@nsmith5
Copy link
Contributor Author

nsmith5 commented Apr 29, 2017

Thanks for your help everyone. This has been one of my first contributions and you made it a good experience.

@nsmith5 nsmith5 deleted the doc/bitshift branch April 30, 2017 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

document that shift operators on BitVectors accept negative shifts Document BitVector shift methods
5 participants