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

Implement integer e-notation #11568

Closed

Conversation

BlobCodes
Copy link
Contributor

@BlobCodes BlobCodes commented Dec 11, 2021

Closes #10154
Allows to use e-notation in integer literals.

1e6i32 # => 1000000

@asterite
Copy link
Member

What about 1.2e3i32? That's a perfectly valid integer.

I also hope this shows this notation can be very confusing, and why I'm against it.

@BlobCodes
Copy link
Contributor Author

BlobCodes commented Dec 11, 2021

This PR does not allow decimal points in integer literals, so "1.2e3i32" would raise an error "Invalid suffix i32 for decimal number"

It also only allows non-negative exponents.

I don't really think it's confusing this way.

@oprypin
Copy link
Member

oprypin commented Dec 11, 2021

Seems we will need to further evaluate the pros and cons of this feature.
Discussion should continue at the issue #10154.

@BlobCodes
Copy link
Contributor Author

Since this PR was not very well-received and I'm not sure myself anymore whether this would be a good change, I'm closing it.

If anyone wants to resurrect this PR, feel free to do so.

@BlobCodes BlobCodes closed this Oct 12, 2023
@BlobCodes BlobCodes deleted the feature/integer-e-notation branch October 12, 2023 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scientific notation for integer literals
4 participants