Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 17 digits of precision with Double.ToString #2823

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

oleks
Copy link

@oleks oleks commented Feb 22, 2023

Using 15 digits ("R") leads to failure of roundtrip serialization/deserialization.

See also https://learn.microsoft.com/en-us/dotnet/api/system.double.tostring

Another example is 0.6822871999174

Using 15 digits ("R") leads to failure of roundtrip
serialization/deserialization.

See also https://learn.microsoft.com/en-us/dotnet/api/system.double.tostring

Another example is 0.6822871999174
@oleks oleks force-pushed the oleks-fix-double-conversion-precision branch from e954f70 to 0796691 Compare February 22, 2023 17:38
@oleks
Copy link
Author

oleks commented Feb 23, 2023

I suppose one could make the argument that it is better to parameterize the library by the format that it should use for Double.ToString, since G17 is also broken, just in a different way.

Serialize(Deserialize<float>("1.1")) != "1.1"

Hence, it is probably best to let the users choose their poison.

@Lucho100789 Lucho100789 linked an issue Mar 12, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[]()
1 participant