#63 Roundtrip double -> string -> double doesn't reproduce input double

0.5.0
open
nobody
None
3
2014-08-15
2013-07-19
osx
No

The current double serialization code doesn't work as good as possible for doubles - the round trip double -> string -> double creates different double output from input in a lot of cases.

The reason for this is that the number of digits (16) used to print the double to string is too low.

This http://stackoverflow.com/a/16941784/2520006 links to some background reading.

The fix is quite simple: Just print 17 digits.

The attached test case demonstrates problem and fix.

1 Attachments

Discussion