Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

decrease rounding error when parsing f64 from JSON #175

Merged
merged 1 commit into from
Dec 25, 2016
Merged

decrease rounding error when parsing f64 from JSON #175

merged 1 commit into from
Dec 25, 2016

Conversation

kdomanski
Copy link
Contributor

As the precision of a floating point number depends
on its magnitude, adding each fractional digit to a large
number accumulates the floating point error quite quickly.

The error is accumulated much slower when assembling
the fractional part separately and then finally adding it
to the large number. Vide: the added test cases.

As the precision of a floating point number depends
on its magnitude, adding each fractional digit to a large
number accumulates the floating point error quite quickly.

The error is accumulated much slower when assembling
the fractional part separately and then finally adding it
to the large number. Vide: the added test cases.
@alexcrichton
Copy link
Contributor

Thanks!

@alexcrichton alexcrichton merged commit f424df8 into rust-lang-deprecated:master Dec 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants