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

Scientific notation literals should not support decimal exponents #2

Open
mathiaspeters opened this issue Jun 14, 2022 · 0 comments
Open
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@mathiaspeters
Copy link
Owner

mathiaspeters commented Jun 14, 2022

Describe the bug
Specifying a literal like 1e2.5 should produce and error but currently just ignores what's after the decimal point.

Expected behavior
An error should be produced and the result field should reflect that

Additional context
The way this is currently implemented is that nom only looks for integers for the exponent so the parse doesn't even see the decimal. A better solution would be to look also for floating point numbers and have a specific validation step before converting to f64. Or just include the decimal exponent when parsing to f64 and let rust take care of it.

@mathiaspeters mathiaspeters added bug Something isn't working good first issue Good for newcomers labels Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant