This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: format-number() causing problems to non-javaimplementators
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] format-number() causing problems to non-javaimplementators
- From: Elliotte Rusty Harold <elharo at metalab dot unc dot edu>
- Date: Thu, 18 Jan 2001 09:37:40 -0500
- References: <200101171805.KAA06788@dragon.flightlab.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
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@metalab.unc.edu | 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