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

Re: XPath floating point arithmetic

Subject: Re: XPath floating point arithmetic
From: Elliotte Rusty Harold <elharo@xxxxxxxxxxxxxxx>
Date: Wed, 20 Mar 2002 12:10:24 -0500
floating cafe
At 4:40 PM +0000 3/20/02, Richard Jinks wrote:
Hi

Can someone ease a bit of confusion for me, please?

In relation to XPath, what would the answer be to the following operation:

5.46 mod 2.6

Should it be

a) 1 (implying the numbers are rounded to nearest integer, then 'mod'ed)
b) 0.26 (implying some sort of floating point mod operation)
c) something else (implying I've got my sums wrong and need to learn how to
use a calculator)



The spec says "This is the same as the % operator in Java and ECMAScript" and in Java 5.46 mod 2.6 is indeed 0.26 (modulo rounding error) If libxml isn't giving you that, then it's a bug.
--


+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@xxxxxxxxxxxxxxx | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|             http://www.cafeconleche.org/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+

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.