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

Serializing double.MaxValue is incorrect #177

Closed
vwxyzh opened this issue May 5, 2016 · 0 comments
Closed

Serializing double.MaxValue is incorrect #177

vwxyzh opened this issue May 5, 2016 · 0 comments

Comments

@vwxyzh
Copy link
Contributor

vwxyzh commented May 5, 2016

double.MaxValue will be serialized as 1.79769313486232E+308
but the real value should be 1.7976931348623157E+308, when deserializing, it will throw OverflowException.

repro:

var s = new Serializer();
var sw = new StringWriter();
s.Serialize(sw, new Dictionary<string, double> { ["a"] = double.MaxValue });
Console.WriteLine(sw.ToString());
var d = new Deserializer();
d.Deserialize<Dictionary<string, double>>(new StringReader(sw.ToString()));
@vwxyzh vwxyzh changed the title serialize double.MaxValue is incorrect Serializing double.MaxValue is incorrect May 5, 2016
@aaubry aaubry closed this as completed Aug 30, 2016
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

No branches or pull requests

2 participants