Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
fix wrong number reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Antares0982 committed Jun 5, 2024
1 parent 17085ca commit 2f91488
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/yyjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -4442,7 +4442,9 @@ static_inline bool read_number(u8 **ptr,
} while (false)

#define return_f64_bin(_v) do { \
*val = PyFloat_FromDouble(((u64)sign << 63) | (u64)(_v)); \
u64 ret = (((u64)sign << 63) | (u64)(_v)); \
double *d = (double *)&ret; \
*val = PyFloat_FromDouble(*d); \
*end = cur; return true; \
} while (false)

Expand Down

0 comments on commit 2f91488

Please sign in to comment.