Re: Double value Xml parsing issue

2007-10-18 Thread krushna sahoo
giv me ur number and location :)

On 10/18/07, Rinilkumar [EMAIL PROTECTED] wrote:

  Yes u can call me dear

 - Original Message -
 *From:* krushna sahoo [EMAIL PROTECTED]
 *To:* c-dev@xerces.apache.org
 *Sent:* Thursday, October 18, 2007 12:31 PM
 *Subject:* Double value Xml parsing issue



  Hi,
 I have some double value e.g 1937.966 in xml file, but after parsing
 through SAX2XMLReader XMLReaderFactory my application getting it as
 1937.95799, which is wrong for my application.

 Can i restrict this type of conversion, I need exact double figure as in
 xml file.


 *Thanks n Regards,**
 Krushna*





Re: Double value Xml parsing issue

2007-10-18 Thread Boris Kolpackov
Hi Krushna,

krushna sahoo [EMAIL PROTECTED] writes:

 I have some double value e.g 1937.966 in xml file, but after parsing through
 SAX2XMLReader XMLReaderFactory my application getting it as 1937.95799,
 which is wrong for my application.

Are you converting the text representation to the double type and
getting 1937.95799 or are you getting the text representation as
1937.95799? If it's the former, then it is most likely due to
1937.966 not being representable by double so you get the next
closest value.

Boris

-- 
Boris Kolpackov
Code Synthesis Tools CC
http://www.codesynthesis.com
Open-Source, Cross-Platform C++ XML Data Binding

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Double value Xml parsing issue

2007-10-18 Thread Axel Weiss
On Thu, 2007-10-18 at 10:12 +0200, Boris Kolpackov wrote:
 1937.966 not being representable by double so you get the next
 closest value.

Boris, this is not true. When I print out the original value 1937.966 in
different IEEE floating point representations, I get the following
results:

as double (64 bits): 1937.966000
as float  (32 bits): 1937.965942

HTH,
Axel


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]