Skip to content

Commit 6e2ab64

Browse files
committed
also account for scientific notation
1 parent f06394f commit 6e2ab64

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
@@ -201,7 +201,7 @@ static bool jimp__get_token(Jimp *jimp)
201201

202202
char *endptr = NULL;
203203
jimp->number.value.i = strtoull(jimp->point, &endptr, 0); // TODO: This implies that jimp->end is a valid address and *jimp->end == 0
204-
if (jimp->point != endptr && *endptr != '.') {
204+
if (jimp->point != endptr && (*endptr != '.' && *endptr != 'E' && *endptr != 'e')) {
205205
jimp->number.type = JIMP_INTEGER;
206206
jimp->point = endptr;
207207
jimp->token = JIMP_NUMBER;

0 commit comments

Comments
 (0)