Skip to content

Commit 5dc8afe

Browse files
committed
also account for scientific notation
1 parent c6b35a6 commit 5dc8afe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/database.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"number": [69, 420, 1337, 80085, .69, 42.123, 123., 9007199254740993, 9007199254740993.0],
2+
"number": [69, 420, 1337, 80085, .69, 42.123, 123., 9007199254740993, 9007199254740993.0, +1, -1, +1.0, -1.0, +.1, -.0, 5e5, 5E5, +5e+5, -5e-5],
33
"profile": [
44
{
55
"location": "Wonderland",

jimp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static bool jimp__get_token(Jimp *jimp)
163163

164164
char *endptr = NULL;
165165
jimp->number.value.i = strtoull(jimp->point, &endptr, 0); // TODO: this implies that jimp->end is a valid address and *jimp->end == 0
166-
if (jimp->point != endptr && *endptr != '.') {
166+
if (jimp->point != endptr && (*endptr != '.' && *endptr != 'E' && *endptr != 'e')) {
167167
jimp->number.type = JIMP_INTEGER;
168168
jimp->point = endptr;
169169
jimp->token = JIMP_NUMBER;

0 commit comments

Comments
 (0)