-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Update comment to resolve ambiguity #120282
Conversation
The documentation is incorrect as the determinant for lower or upper case is the 5th bit not the 6th bit as written in the codebase.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
For ref #118236 |
Simply wrong. 'O' = 79 = 0b01001111, 'P' = 80 = 0b01010000. Don't rely on the book without actually checking it :) |
E = 0 1 0 0 0 1 0 1 |
Incase we are still not clear ,the low order bit is the rightmost bit ,it has a place value of zero , hence called the zero bit , any bit number is counted from the zero bit as origin . |
I get what makes you confused and apologize for my misunderstanding. However I just found that most people will call it the 6th bit by https://www.google.com/search?q=ascii+capital+bit+xor. |
nothing i said is actually wrong as pointed out by you , |
The usage by people doesnt make the counting standard |
https://www.geeksforgeeks.org/program-toggle-characters-string/ |
Honestly we shouldn't be arguing over whether to call it 5th or 6th bit, both are equally confusing unless a labeled byte diagram is provided both 5 and 6 are valid. If you really wanted to know which bit was being masked a quick google search would tell you which bit is being masked |
If you prefer standards, in ISO-IR-6: ASCII Graphic character set or ANSI INCITS 4-1986 they are called b1..b7 (since b8 is not used). |
r=me with suggestion or equivalent text applied and squashed into one commit. Otherwise I'm not inclined to change one number to the other; both seem equally not helpful to me. |
adequate changes made Co-authored-by: Mark Rousskov <[email protected]>
Squash please |
@mahmudsudo any updates on this? |
I have resolved the suggested change to the commit |
This still needs to be squashed. @rustbot author |
Ping from triage: I'm closing this due to inactivity, Please reopen when you are ready to continue with this. @rustbot label: +S-inactive |
I'd like to help move this PR forward |
Update the doc comment of `ASCII_CASE_MASK` Revived and continued the work from rust-lang#120282. the original [branch](https://github.com/mahmudsudo/rust-1/tree/patch-1) was deleted, i created a new branch to carry the changes forward
Rollup merge of rust-lang#132851 - chansuke:update-comment, r=thomcc Update the doc comment of `ASCII_CASE_MASK` Revived and continued the work from rust-lang#120282. the original [branch](https://github.com/mahmudsudo/rust-1/tree/patch-1) was deleted, i created a new branch to carry the changes forward
The documentation is incorrect as the determinant for lower or upper case is the 5th bit not the 6th bit as written in the codebase.
An excerpt from the book the art of assembly language lays credence to this :
"Upper case characters always contain a zero in bit five; lower case alphabetic characters always contain a one in bit five. You
can use this fact to quickly convert between upper and lower case. If you have an upper
case character you can force it to lower case by setting bit five to one."