W3C home > Mailing lists > Public > public-qt-comments@w3.org > December 2003

[F&O] 6.2.6 op:numeric-mod

From: David Carlisle <davidc@nag.co.uk>
Date: Tue, 2 Dec 2003 17:19:45 GMT
Message-Id: <200312021719.RAA26940@penguin.nag.co.uk>
To: public-qt-comments@w3.org

The description of mod uses expressions the expression
(a idiv b)*b+(a mod b) 
that is (one assumes) XPath/Xquery, (although other cases of explict
xpath examples the operators have op: or fn: syntax so this probably
ought to be
op:numeric-multiply(op:numeric-integer-divide(a,b) ,b)...

however it also uses the phrase

  the result obeys (a/b)*b+(a mod b) = a. Division is truncating division,
  analogous to integer division, not [IEEE 754-1985] rounding division.

The expression there is a valid Xpath, but not the desired expression:-)
I assume that the second sentence is intended to give a local definition
of "/" but
a) I think some other syntax should be used in
   preference to "/" to avoid confusion, and
b) I don't think "analogous to integer division" is clear enough as a

If a and b are positive I assume you want something 
equivalent to the Xpath floor(a div b)*b+(a mod b) = a
Although It's not clear whether mod should be _defined_ that way in
terms of the Xpath floor and div (which may affect certain edge cases).


This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
Received on Tuesday, 2 December 2003 12:20:15 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:15 UTC