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

Re: XPath MOD 10 calculation

Subject: Re: XPath MOD 10 calculation
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Fri, 25 May 2007 16:27:49 +0100
Re:  XPath MOD 10 calculation
On 5/25/07, David Carlisle <davidc@xxxxxxxxx> wrote:
Note you only need to do that if calculating the check digit, (when it
matters that you get 0 not 10) if you are just checking that a given
checksum is right then you don't need that complication as using 10 or 0
is the same in a (..) mod 10 = 0 test.

If you a_re_ calculating the digit, rather than write
(10 - (foo mod 10)) mod 10
it's probably more natural just to use
-(-foo mod 10)

Out of interest, why is:


-(-foo mod 10)

not the same as:

foo mod 10

?

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.