diff --git a/parser.go b/parser.go index 84c31d0..b304182 100644 --- a/parser.go +++ b/parser.go @@ -968,7 +968,7 @@ byteLoop: func (p *parser) scanIntOrFloat(b []byte) (ast.Reference, []byte, error) { i := 0 - if len(b) > 2 && b[0] == '0' && b[1] != '.' && b[1] != 'e' { + if len(b) > 2 && b[0] == '0' && b[1] != '.' && b[1] != 'e' && b[1] != 'E' { var isValidRune validRuneFn switch b[1] { diff --git a/unmarshaler_test.go b/unmarshaler_test.go index 075fbeb..e76e853 100644 --- a/unmarshaler_test.go +++ b/unmarshaler_test.go @@ -155,6 +155,11 @@ func TestUnmarshal_Floats(t *testing.T) { input: `0e0`, expected: 0.0, }, + { + desc: "float upper exponent zero", + input: `0E0`, + expected: 0.0, + }, { desc: "float fractional with exponent", input: `6.626e-34`,