Closed jaakkor2 closed 3 years ago
The spec says that for float, leading zeros are not allowed, for example:
a = 03.14
errors in https://toml-parser.com/ (but parse(Float64, "03.14")
) works. So leading zeros are not allowed in 03.14
but allowed in 0e-3
?
https://toml-parser.com/ says for a=00e-3
Error while parsing floating-point: leading zeroes are prohibited (error occurred at line 1, column 4)
Okay, the part before the .
or the exponential part parses as an integer. So 0
is fine before e-3
because the integer 0
is valid integer. 03
is not fine before .14
because 03
is not a valid integer.
This is with Julia v1.6.0
gives
This works
https://toml.io/en/v1.0.0#float does not say
0e-3
should not work.Online https://toml-parser.com/ parser reads
a=0e-3
just fine.Julia parses
parse(Float64, "0e-3")
fine as well.