-
-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: minimize the precision loss when dumping double to string (#712)
* fix: minimize the precision loss when dumping double to string * abandon one-time macro * replace hard-coded buffer size, replace `sprintf` with `snprintf` * replace `DECIMAL_DIG` with `DBL_DECIMAL_DIG` * Update json.h changed to C++11 DECIMAL_DIGIT * added cfloat include * identify float and double as different numeral types, and approach their precisions accordingly --------- Co-authored-by: June Han <[email protected]> Co-authored-by: gittiver <[email protected]>
- Loading branch information
1 parent
fb171f5
commit 973d5fa
Showing
3 changed files
with
43 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters