XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (96 page)

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
3.37Mb size Format: txt, pdf, ePub
ads

Except for NaN, number values are
ordered
. Arranged from smallest to largest, they are:

  • Negative infinity
  • Negative finite non-zero values
  • Zero (positive and negative zero are equal to each other)
  • Positive finite non-zero values
  • Positive infinity

This ordering determines the result of less-than and greater-than comparisons, and in XSLT it determines the result of sorting using

or

with a sort key specified using

.

NaN is
unordered
, so the operators
<
,
<=
,
>
, and
>=
return false if either or both operands are NaN. However, when

is used to sort a sequence of numeric values that includes one or more NaN values, NaN values are collated at the start of the sequence (or at the end if you choose descending order).

Positive zero and negative zero compare equal. This means that the operators
=
,
<=
, and
>=
return true, while
!=
,
<
, and
>
return false. However, other operations can distinguish positive and negative zero; for example,
1.0 div $x
has the value positive infinity if
$x
is positive zero, and negative infinity if
$x
is negative zero.

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
3.37Mb size Format: txt, pdf, ePub
ads

Other books

Defiant Spirits by Ross King
What's Cooking? by Sherryl Woods
The Golden Braid by Melanie Dickerson
Forbidden Surrender by Carole Mortimer
The Last Crusade by Ira Tabankin
Real Men Will by Dahl, Victoria
Cluny Brown by Margery Sharp
Kissed by a Cowboy by Lacy Williams