You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by krushna sahoo <kr...@gmail.com> on 2007/10/18 09:01:04 UTC

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

Posted by Axel Weiss <aw...@informatik.hu-berlin.de>.
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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Double value Xml parsing issue

Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Hi Krushna,

krushna sahoo <kr...@gmail.com> 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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: Double value Xml parsing issue

Posted by krushna sahoo <kr...@gmail.com>.
giv me ur number and location :)

On 10/18/07, Rinilkumar <ri...@hp.com> wrote:
>
>  Yes u can call me dear
>
> ----- Original Message -----
> *From:* krushna sahoo <kr...@gmail.com>
> *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

Posted by Rinilkumar <ri...@hp.com>.
Yes u can call me dear
  ----- Original Message ----- 
  From: krushna sahoo 
  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