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

Re: format-number() causing problems to non-javaimplem

Subject: Re: format-number() causing problems to non-javaimplementators
From: Elliotte Rusty Harold <elharo@xxxxxxxxxxxxxxx>
Date: Thu, 18 Jan 2001 09:37:40 -0500
floating point problems with xsl
At 10:05 AM -0800 1/17/01, Joe English wrote:

 BTW: Are there more functions causing problems for non Java
 implementators?

The requirement that numbers are represented as per IEEE 754 is troublesome. There's no portable way to deal with NaNs and infinities in C, C++, or most other languages (C9X makes things a little easier, but implementations aren't widely available yet.)

The 'string()' function is astonishingly difficult to implement
correctly without native language support, specifically clause 2,
subclause 7, XPATH section 4.2: "there must be as many, but only
as many, more digits as are needed to uniquely distinguish the
number from all other IEEE 754 numeric values."


This isn't a Java issue though. Pretty much all modern, general-purpose CPUs that implement floating point use IEEE 754. As well as Java, so do many C, C++, and Fortran compilers. The decision was to go with an existing, well-known, well-understood, well-supported, true standard. Failure of some languages, compilers, and libraries to properly implement that standard is a very different issue than tying XSLT to a non-standard, proprietary API.
--


+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@xxxxxxxxxxxxxxx | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|                  The XML Bible (IDG Books, 1999)                   |
|              http://metalab.unc.edu/xml/books/bible/               |
|   http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://metalab.unc.edu/javafaq/ |
|  Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/     |
+----------------------------------+---------------------------------+

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


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.