Do JSON libraries agree on what's the double-precision value of .5000...1?
<p>If I need to transmit floating-point numbers exactly from C# to JSON to Java, can I use JSON numbers?</p>

<p>If not, why not? What information could be lost and how can I guarantee to retain that?</p>

<p>To be specific, I'm using Json.NET in C# and Jackson (through its class ObjectMapper) in Java.</p>

<p>It looks like double.TryParse is what is ultimately used when Json.NET parses a number to double and Double.parseDouble is what is ultimately used when Jackson ObjectMapper parses a number to double.</p>

<p>Can I expect Microsoft's <a href="https://msdn.microsoft.com/en-us/library/3s27fasw%28v=vs.110%29.aspx" rel="nofollow noreferrer">double.TryParse</a> and Java's <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Double.html#valueOf%28java.lang.String%29" rel="nofollow noreferrer">Double.parseDouble</a> to agree exactly on the value of every JSON number?</p>

<p>I am concerned because the number of digits in a JSON number is not bounded in ECMA-404, IETF RFC 7159, or json.org. This other question (<a href="https://stackoverflow.com/questions/17244898">Maximum number of decimal digits that can affect a double</a>) makes me wonder how much I can trust a common belief that the first block of 17 decimal digits (having discarded leading zeroes), or in fact any bounded number of decimal digits, is sufficient to determine a double-precision floating-point value.</p>