Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix round trip floating point bug on x64 platforms #50
Short version: This pull request changes the format string for doubles and floats from
This is essentially the same as #10, except for floating-point numbers.
Note that this commit contains the actual fix: PathogenDavid@3d3983a (The other commits only touch the tests.)
The bug can be observed by checking out PathogenDavid@a0dbebf (which includes a test for the bug, but does not fix it.)
If you run it in x64 mode
This change is technically a breaking change (which is why dotnet/coreclr#13140 was eventually rejected.) The deserialized values of previously serialized data should be identical. However, it will likely not serialize to the exact same string.
This is caused by the fact that the
In addition to fixing this issue, I've added a test that verifies edge-case floating point values round-trip as expected.
It is may be worth noting that it is unclear if
Yeah, I wasn't crazy about that either, but I feel like round-trip consistency is probably more important for serialization purposes. If it bothers someone enough, it would not be terribly hard to add something to
No problem, thanks for the merge!
Indeed, let's see.