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

Parsing of '.' #2

Closed
RazrFalcon opened this issue Dec 16, 2018 · 2 comments
Closed

Parsing of '.' #2

RazrFalcon opened this issue Dec 16, 2018 · 2 comments
Labels
bug Something isn't working

Comments

@RazrFalcon
Copy link
Contributor

RazrFalcon commented Dec 16, 2018

Rust will parse . as Err(ParseFloatError { kind: Invalid }), while rust-lexical will parse it as 0.0. Not sure which one is the "correct" one.

@Alexhuszagh Alexhuszagh added the bug Something isn't working label Dec 16, 2018
@Alexhuszagh
Copy link
Owner

This is unintended behavior, and should be fixed. Great catch. Both "0." and ".0" are valid, however, "." is not.

Alexhuszagh pushed a commit that referenced this issue Dec 16, 2018
@Alexhuszagh
Copy link
Owner

Fixed as of f0707c0. "0." and ".0" are both still considered valid floats. Please note you must use the "try_atof64_slice" in order to get the desired behavior.

Alexhuszagh pushed a commit that referenced this issue Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants