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

Incorrect parsing of integer constants like 2e1 #4485

Open
lmbarros opened this issue Nov 13, 2024 · 1 comment · May be fixed by #4580
Open

Incorrect parsing of integer constants like 2e1 #4485

lmbarros opened this issue Nov 13, 2024 · 1 comment · May be fixed by #4580
Labels
bug replicated We were able to replicate the bug.

Comments

@lmbarros
Copy link

Context

Originally mentioned in #4481 (comment) , moving to a separate issue.

Failure Information (for bugs)

Steps to Reproduce

This program

main :: proc() {
	i: int = 2e1
	j: int = 2.2e1
	fmt.printfln("%v, %v", i, j)
}

gives me this result:

10, 22

I'd expect 2e1 to be 20.

@Kelimion Kelimion added bug replicated We were able to replicate the bug. labels Nov 13, 2024
@dislux-hapfyl
Copy link

dislux-hapfyl commented Dec 14, 2024

package test
import  "core:fmt"
main :: proc()  {
    x: int = 2.e1
    y: int = 2.2e1
    fmt.printfln("%v, %v", x, y)
}

20,22

You forgot the period.

@tf2spi tf2spi linked a pull request Dec 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug replicated We were able to replicate the bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants