It's not a bug: v1.0 is doing double-precision floating point arithmetic, while v2.0 is doing decimal arithmetic. Double-precision arithmetic converts the values 70 and 0.01 to the nearest doubles, and then multiplies them. The decimal value 0.01 cannot be represented exactly by a double, so a rounding error occurs.
The simplest remedy for this is to display the result to a suitable number of decimal places by using format-number().
Michael Kay

From: Ryan Puddephatt []
Sent: 23 March 2009 17:05
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: [saxon] XSL 1.0 Math Bug


                I’ve been struggling with a problem I found when using the latest Saxon-B with an XSLT 1.0 stylesheet (pasted below).


<xsl:stylesheet version="1.0" xmlns:xsl="">

  <xsl:template match="in">


      <xsl:value-of select="70 * 0.01" />





I found that the result of this was unexpectedly




But with version as 2.0 I get the expected




Any ideas why there is a difference, is there a quick work around? I’d prefer not to change the XSL if possible. Also will there be a bug fix for this?







Ryan Puddephatt

Connectivity Developer

Fidessa LatentZero

1 Old Jewry

London EC2R 8DN

Office: +44 (0) 20 7105 1000

Direct: +44 (0) 20 7105 1821

Blackberry: +44 (0) 79 8539 2458

Fax: +44 (0) 20 7105 1818




The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.

This e-mail has been scanned for viruses by Verizon Business Internet Managed Scanning Services - powered by MessageLabs. For further information visit