RE: More F&O issues

Thank you for your comments.  Please see below.

All the best, Ashok

-----Original Message-----
From: XQuery [mailto:xquery@attbi.com] 
Sent: Saturday, January 25, 2003 11:43 PM
To: public-qt-comments@w3.org
Subject: More F&O issues


5.2
- After the link to Issue 177 (reporting underflow/overflow), there is a
list that starts "Finally, consider some examples involving special IEEE
754
numerics."  This list is nonsense.  Although the first bullet stands,
the
other two bullets do not.  To take just two examples, 1 div INF is 0.0
and
INF + -INF is NaN.

[This is like the bajillionth time the XQuery drafts have said "IEEE
754"
and something nonsensical a sentence later.  If you don't understand
computer arithmetic, please don't attempt to summarize how it works.]

[AM] Fixed.


5.2.6
- The definition of op:numeric-mod is incorrect.  It is not "the
remainder
after dividing the first operand by the second", because xs:decimal
division
is exact (there would never be a remainder).  I suspect you mean that M
mod
N is the unique value 0 <= r < N such that q * N + r = M for some
integer q.
You should also consider what happens for negative M and N, or N = +/-1
and
ensure the definition makes sense for these cases.

[AM] Fixed.

- The list of special casts for xs:float and xs:double seems incorrect.
Specifically, the third bullet says that if not NaN, the sign of the
result
equals the sign of the dividend.  But then combined with the last
bullet,
this means that -X mod X = -X mod -X = -0.0.  I'm pretty sure both of
these
should be +0.0.  Can you clarify?  (Very few IEEE operations result in
-0.0
-- typically, just division and multiplication.  The modulus is defined
by
addition/subtraction, so I'm wary of a modulo definition that yields
-0.0 in
anything other than exceptional cases.)

[AM] The rule that the sign of the result is the sign of the dividend is
included in the descriptions of the mod operator for C, C++ and ECMA
Script.

14.2.7, 14.2.8
- Are these functions allowed to return the result in any order even
when
there were no duplicates?  The text seems to say yes, the examples seem
to
say no.
[AM] No such example in latest spec.

14.2.9, 14.2.10
- The description of insert/remove is incorrect.  Why should floor() be
applied to position (which is already typed as integer in the function
signature)?  Also notice that the cast to unsignedInt will fail with an
error if N is less than 0, so the first condition in the following
paragraph
would never apply. [Probably just need to remove the second paragraph,
the
one invoking the cast.]
[AM] The definitions of these functions have been changed.

- I assume that the phrase "a copy ... is returned" is just trying to
clarify that the original sequence is unmodified.  However, you have to
take
care here, because this could also be interpreted as meaning that all
items
in the returned sequence have been copied (which would destroy node
identity).

Received on Friday, 7 February 2003 10:09:56 UTC