Bwar / CJsonObject

Ultralightweight JSON parser in C++ based on cJSON
MIT License
648 stars 239 forks source link

prase_number #20

Closed mousexie closed 3 years ago

mousexie commented 4 years ago

解析这个字串时:1283949231388184576 返回:1283949231388184320

Bwar commented 3 years ago

linux下测试过当前最新版本没有这个问题,你的环境和版本是?

mousexie commented 3 years ago

windows版本下vs2017编译器,解析出来的数字不一样。如string str = "{\"entrustId\":1331796695786074117}"; 返回:1331796695786073856

Bwar commented 3 years ago

这是因为parse_number时用了long double来存储,而windows下long double精度不够所致,暂未解决。