travisstaloch / simdjzon

simdjson port to zig
103 stars 5 forks source link

fix bug where 0.1 was parsed wrong #5

Closed sharpobject closed 2 years ago

sharpobject commented 2 years ago

For numbers with lz = 63 before the multiply and multiply results with a leading zero, lz would overflow and become 0, so the parsed result would be too big by a factor of 2^64. Some numbers like this are 0.1 and 0.01. Added these to the test.

travisstaloch commented 2 years ago

Nice catch and thanks a bunch for the patch! Looks good. I appreciate the additional test cases too! :+1: