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

Fixes for issues with parsing and lexing numbers #5776

Closed
wants to merge 3 commits into from

Conversation

huonw
Copy link
Member

@huonw huonw commented Apr 8, 2013

Addresses #5544 and #5770, as well as a comment left in the documentation of from_str_bytes_common, so that there is now an option to ignore underscores.

huonw added 3 commits April 8, 2013 16:35
…2^n numbers.

A number like 0b1_1111_1111 == 511 would be parsed to Some(255u8) rather than None
by from_str_common, since 255 * 2 + 1 == 255 (mod 256) so the overflow wasn't detected.

Only applied to conversions where the radix was a power of 2, and where all digits
repeated.

Closes rust-lang#5770.
Implement the possible improvement listed in the comment on
from_str_bytes_common.
bors added a commit that referenced this pull request Apr 8, 2013
…nger

Addresses #5544 and #5770, as well as a comment left in the documentation of `from_str_bytes_common`, so that there is now an option to ignore underscores.
@bors bors closed this Apr 8, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants