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

Fix parsing of integer w/ 'e' notation #4580

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tf2spi
Copy link
Contributor

@tf2spi tf2spi commented Dec 14, 2024

Closes #4485 by making floating point values with 'e' and without a '.' treated as floats rather than ints.

@tf2spi tf2spi changed the title Make floats with 'e' not treated as ints Draft: Make floats with 'e' not treated as ints Dec 17, 2024
@tf2spi
Copy link
Contributor Author

tf2spi commented Dec 17, 2024

Marked as draft b/c there may be other ways that floating point numbers are incorrectly parsed as big ints (like w/ '0x' and 'p', though IIRC, it's taken care of in other code above) and there may be a better way, like parsing a big int and observing the status code rather than doing syntactical checks.

@tf2spi tf2spi force-pushed the 4485-fix-exact-value-float branch from de1c0ee to 26f9688 Compare December 21, 2024 21:53
@tf2spi tf2spi changed the title Draft: Make floats with 'e' not treated as ints Fix parsing of integer w/ 'e' notation Dec 21, 2024
@tf2spi
Copy link
Contributor Author

tf2spi commented Dec 21, 2024

The original problem actually wasn't that ints were being parsed with 'e' notation. They were supposed to be but the destination got overwritten with 10**exponent rather than number * 10**exponent like it was supposed to.

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.

Incorrect parsing of integer constants like 2e1
1 participant