W3C home > Mailing lists > Public > public-qt-comments@w3.org > March 2004

RE: [XSLT 2.0] Data types for a Basic XSLT processor

From: Michael Kay <mhk@mhk.me.uk>
Date: Thu, 18 Mar 2004 13:52:19 -0000
To: "'Colin Paul Adams'" <colin@colina.demon.co.uk>
Cc: <public-qt-comments@w3c.org>
Message-Id: <20040318135224.16B79A12E5@frink.w3.org>

It's possible to implement xs:integer using 64-bit hardware arithmetic, I
believe*. It's certainly possible to implement it so that it uses hardware
arithmetic when the numbers are small enough. I've no idea about xs:decimal
- I grew up with machines that did decimal arithmetic in hardware, but I
suspect that's gone out of fashion? As for float and double, surely 32-bit
floating point is a complete anachronism? 20 years ago I was using
mainframes - a thousand times slower than my laptop today - that only
offered 64-bit and 128-bit floating point in the hardware, and emulated
32-bit float in software.

But this is aside from the point. I don't believe that numeric arithmetic
accounts for a sufficiently high proportion of XSLT execution costs for this
to be a real concern.

Michael Kay 

* (Schema Part 2): "All .minimally conforming. processors .must. support
decimal [and hence integer] numbers with a minimum of 18 decimal digits
(i.e., with a .totalDigits. of 18)". 64 bits is enough to meet this
requirement. I think the word "minimum" here is meaningless, and best
ignored.

# -----Original Message-----
# From: Colin Paul Adams [mailto:colin@colina.demon.co.uk] 
# Sent: 18 March 2004 11:36
# To: Michael Kay
# Cc: public-qt-comments@w3c.org
# Subject: Re: [XSLT 2.0] Data types for a Basic XSLT processor
# 
# >>>>> "MK" == Michael Kay <mhk@mhk.me.uk> writes:
# 
#     MK> (a) I think there are likely to be very few stylesheets whose
#     MK> performance will benefit noticeably from using 32-bit rather
#     MK> than 64-bit arithmetic. If you're going to trade correctness
#     MK> of output for speed of output, you need a very clear view of
#     MK> how much performance you think you can gain by it.
# 
# But xs:decimal and xs:integer are NOT hardware types, limited 
# to 64-bits of precision. At least, that's how I understand 
# XML Schema. I read them as being arbitrary precision numbers 
# and integers (with a cop-out clause).
# 
# My point was, why include xs:double (rather than xs:float - 
# presumably faster), and not include a hardware integer type?
# --
# Colin Paul Adams
# Preston Lancashire
# 
Received on Thursday, 18 March 2004 08:52:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:07 GMT