Hi Manohar,
This is obviously to do with rounding errors in the floating point conversion. There will always be some numbers that will not interpret exactly to a given length because of the way that the number is held internally. I would need to work out what 555.555 looked like as a floating point number, but I'm sure it will not be able to be represented exactly within the limits of a float type. Thus a certain amount of accuracy is lost. It could be that we are compounding errors somewhere or we need to look at how we store and recover numbers. We may also need to look at how much accuracy is 'actually' available in floating point numbers.
Regards,
Fred Preston.
| Manohar K Chintala <[EMAIL PROTECTED]>
30/09/2005 09:11
|
To: "Apache AXIS C Developers List" <[email protected]> cc: Subject: Re: [jira] Created: (AXISCPP-838) The serialisation of 555.555 as a float produces a value of 555.554993 on the wire. |
I've observed that when result is displayed using "%.5f" this problem
occurs. If result is displayed using "%.3f" the output is 555.555, and for
"%.4f" the output is proper 555.5550. Also, this problem happens with 1,5,7
and 9 numbers when only. i.e. when the values given like 555.111 ,
555.555, 555.777 and 555.999 this serialization problem occurs and for
other numbers it works fine.
Regards
Manohar
"Fred Preston
(JIRA)"
<[EMAIL PROTECTED] To
ache.org> [email protected]
cc
09/28/2005 04:21
PM Subject
[jira] Created: (AXISCPP-838) The
serialisation of 555.555 as a float
Please respond to produces a value of 555.554993 on
"Apache AXIS C the wire.
Developers List"
The serialisation of 555.555 as a float produces a value of 555.554993 on
the wire.
-----------------------------------------------------------------------------------
Key: AXISCPP-838
URL: http://issues.apache.org/jira/browse/AXISCPP-838
Project: Axis-C++
Type: Bug
Components: Serialization
Environment: n/a
Reporter: Fred Preston
Using the UnitTest_XSD_float test. If you change the code as follows:-
Was
[40]// Test non-nillable element
[41] xsd__float result =
ws->asNonNillableElement((xsd__float)35.353588);
Now
[40]// Test non-nillable element
[41] xsd__float result =
ws->asNonNillableElement((xsd__float)555.555);
Then on the wire you get:-
<nonNillableElement>555.554993</nonNillableElement>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
