Fixed serialization for floating point values less than EPSILON.#372
Conversation
|
I found why the tests are failing in an unrelated way - for some reason |
juntyr
left a comment
There was a problem hiding this comment.
Could you file a short issue for this bug and then link that in a CHANGELOG entry? Otherwise, this looks good to me - thanks for catching the issue!
|
Thanks for opening the issue @KirbyER! Could you rebase your branch and add the following line (or a better description) to the bottom of the unreleased section of the CHANGELOG: Thanks again for catching this bug and finding a fix! |
|
Sorry, got pulled away yesterday between opening the issue and updating the changelog. Done now. Thanks for sorting out the testing failure so quickly! |
…-rs#372) Co-authored-by: KirbyER <7432155-KirbyER@users.noreply.gitlab.com>
Since
EPSILONis defined as the difference between 1 and the next highest value, and values close to zero have higher precision, very small values were serialized with an extra ".0" e.g. "0.00000000000000005.0". These values then can't be properly deserialized. This fix compares the fractional part of the float to 0.0 instead of usingEPSILON.Fixes #374.
CHANGELOG.md