[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XSLT 2.0 Decimal number silliness

Subject: RE: XSLT 2.0 Decimal number silliness
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 25 Mar 2004 19:12:10 -0000
xsl significant digits
# Two possibilities.  One is to allow some way to specify 
# default number of fraction digits in the absence of a schema. 
#  Another is to implement a fixed precision and document it.  
# I have chosen to implement 18 integer digits plus 18 fraction 
# digits.  I believe this is legitimate according to the spec 
# (tell me if I'm wrong), and it's a whole lot easier to 
# explain to users.  Plus, you get exactly the same answers no 
# matter how you calculate two-thirds in my examples below.

The schema spec says that a total of 18 digits in total is sufficient (both
for xs:integer and for xs:decimal). However, xs:unsignedLong requires 20
digits, and that's derived by restriction from xs:integer, so I don't know
where the 18 came from.

My implementation is using infinite precision for xs:decimal, which is why I
have to make some kind of cut-off on division. Another option I considered
was to keep max(18, M, N) significant digits where M and N are the number of
significant digits in the operands.

I tend to agree with you that I would much rather have an interoperable spec
on this. However, some of the XQuery vendors push hard against this,
especially those who are trying to translate XPath predicates into SQL
predicates.

Michael Kay

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.