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

Enhanced RDoc for Integer #5134

Merged
merged 2 commits into from
Nov 17, 2021
Merged

Enhanced RDoc for Integer #5134

merged 2 commits into from
Nov 17, 2021

Conversation

BurdetteLamar
Copy link
Member

Treated:

  • #==
  • #<=>
  • #<
  • #<=
  • #>
  • #>=
  • #&
  • #|
  • #^

@BurdetteLamar BurdetteLamar added the Documentation Improvements to documentation. label Nov 17, 2021
Copy link
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

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

Looks mostly good. I think the bitwise operator examples should be simplified, please see the inline comment.

numeric.c Outdated
* "%08b" % result # => "00000000"
*
* other = 0b11111111
* "%08b" % n # => "01010101"
Copy link
Contributor

Choose a reason for hiding this comment

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

This example section is probably not what you want. You probably want to add result = n & other.

However, I think these examples are too long-winded. Maybe just a single example:

"%04b" % (0b0101 & 0b0110) => "0100"

That is a complete succinct example with all 4 states (neither set, both set, only receiver set, only argument set).

I would use a similar single example for | and ^.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. The stacked bits seemed more important b/c I used 8-bit values; with 4-bit values, unnecessary.

Copy link
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

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

Looks good!

@BurdetteLamar BurdetteLamar merged commit 4acac91 into ruby:master Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements to documentation.
2 participants