odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
7.01k stars 621 forks source link

Incorrect parsing of integer constants like `2e1` #4485

Open lmbarros opened 1 week ago

lmbarros commented 1 week ago

Context

Originally mentioned in https://github.com/odin-lang/Odin/issues/4481#issuecomment-2473762184 , 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.