Bugzilla – Bug 5381
Loss of precision for xsd:float and xsd:double
Last modified: 2008-01-11 13:26:10
You need to log in before you can comment on or make changes to this bug.
globus_soap_message_serialize.c converts a double to a string by using sprintf("%E"). From the man page: e,E The double argument is rounded and converted in the style [-]d.dddeħdd where there is one digit before the decimal-point character and the number of digits after it is equal to the pre- cision; if the precision is missing, it is taken as 6 In other words, if the sender specifies an xsd:float or xsd:double as 0.97587222395 what goes on the wire is 9.758722E-01 One possible remedy is to change the formatting string to something like "%15E" or "%30E" or whatever people would consider an acceptable precision. 6 digits is probably too little though.
Just to add some info, a 64 bit double needs 16 digits of precision for full representation...
Committed fix to 4.0 and trunk