Subject: RE: [xsl] decimal vs double value spaces From: "Michael Kay" <mike@xxxxxxxxxxxx> Date: Thu, 5 Nov 2009 11:49:01 -0000 |
The value space of xs:double is fully defined in the spec, based on IEEE specifications. The value space of xs:decimal isn't fully defined, in that limits on the number of digits are implementation-defined. However, every value in the xs:decimal value space is a multiples of 10^-n where n is implementation-defined, and so long as you're within the expected number of digits, decimal arithmetic should be exact, whereas double arithmetic in general will involve rounding on input and output (that is, conversion from string->double and from double->string). > but note that some (possibly > unfinished/ possibly naive) Java XPath engines internally > represent xs:decimal and xs:double as Java doubles Representing xs:decimal using Java doubles will give completely non-conformant results which I don't think can be justified by any appeal to the implementation-defined limits on precision. Regards, Michael Kay http://www.saxonica.com/ http://twitter.com/michaelhkay
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] decimal vs double value space, Justin Johansson | Thread | Re: [xsl] decimal vs double value s, C. M. Sperberg-McQue |
[xsl] decimal vs double value space, Justin Johansson | Date | [xsl] how to exclude namespaces fro, cert21 |
Month |