[xsd-users] losing double precision in output xml

Boris Kolpackov boris at codesynthesis.com
Thu Dec 7 10:24:21 EST 2006


Hi David,

I've CC'ed xsd-users to my reply so that others can benefit from this
information.


David J Stockdill <dstockdi at csc.com> writes:

> 38.200000000001 is truncated to 38.2
> 38.20000000001 is not.  How do I specify to keep more than 11 digets after
> the decimal?

I think I have finally found the right formula for the serialization
precision of floating-point types. See this paper for details:

http://www2.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1822.pdf


The fix is available here:

http://codesynthesis.com/download/xsd/2.3/xsd-2.3.0-fp-serialization-patch.zip
http://codesynthesis.com/download/xsd/2.3/xsd-2.3.0-fp-serialization-patch.tar.gz


Simply replace the libxsd/xsd/cxx/tree/serialization.hxx file with the
new revision. This fix will also appear in the upcoming 2.3.1 version.

Please let me know if things are working now and thanks for helping to
track this problem down!


-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20061207/bb37493f/attachment.pgp


More information about the xsd-users mailing list