You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Samisa Abeysinghe (JIRA)" <ax...@ws.apache.org> on 2004/12/14 06:02:55 UTC

[jira] Reopened: (AXISCPP-320) float number, 77.99 becomes 77.989998 in output string

     [ http://nagoya.apache.org/jira/browse/AXISCPP-320?page=history ]
     
Samisa Abeysinghe reopened AXISCPP-320:
---------------------------------------


Lets use %g18 for double and %g9 for float in sprintf for serializing.

This means we have reduced error rate as far as precision is concerned.

BTW XSD spec says:
decimal represents a subset of the real numbers, which can be represented by decimal numerals. The - value space-  of decimal is the set of numbers that can be obtained by multiplying an integer by a non-positive power of ten, i.e., expressible as i × 10^-n where i and n are integers and n >= 0. Precision is not reflected in this value space; the number 2.0 is not distinct from the number 2.00. The - order-relation-  on decimal is the order relation on real numbers, restricted to this subset.

  float is patterned after the IEEE single-precision 32-bit floating point type [IEEE 754-1985]. The basic - value space-  of float consists of the values m × 2^e, where m is an integer whose absolute value is less than 2^24, and e is an integer between -149 and 104, inclusive. In addition to the basic - value space-  described above, the - value space-  of float also contains the following three special values: positive and negative infinity and not-a-number (NaN). The - order-relation-  on float is: x < y iff y - x is positive for x and y in the value space. Positive infinity is greater than all other non-NaN values. NaN equals itself but is - incomparable-  with (neither greater than nor less than) any other value in the - value space- .

The double datatype is patterned after the IEEE double-precision 64-bit floating point type [IEEE 754-1985]. The basic - value space-  of double consists of the values m × 2^e, where m is an integer whose absolute value is less than 2^53, and e is an integer between -1075 and 970, inclusive. In addition to the basic - value space-  described above, the - value space-  of double also contains the following three special values: positive and negative infinity and not-a-number (NaN). The - order-relation-  on double is: x < y iff y - x is positive for x and y in the value space. Positive infinity is greater than all other non-NaN values. NaN equals itself but is - incomparable-  with (neither greater than nor less than) any other value in the - value space- .



> float number, 77.99 becomes 77.989998 in output string
> ------------------------------------------------------
>
>          Key: AXISCPP-320
>          URL: http://nagoya.apache.org/jira/browse/AXISCPP-320
>      Project: Axis-C++
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.4 Final
>  Environment: All platforms
>     Reporter: Samisa Abeysinghe
>     Assignee: Samisa Abeysinghe
>      Fix For: current (nightly)

>
> Jean .A - Canada ->
> Well, I have a strange behavior with floating number and date time format.
> 1 ) With float number, 77.99 becomes 77.989998 output string under
> Axis. Why I lost some digits ??????!!!
> See http://marc.theaimsgroup.com/?t=110260619200001&r=1&w=2 for more details.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira