OrderedQ

OrderedQ[h[e1,e2,]]

gives True if the ei are in canonical order, and False otherwise.

Details

  • OrderedQ[{e,e}] gives True.
  • By default, OrderedQ uses canonical order as described in the notes for Sort.
  • OrderedQ[list,p] uses the ordering function p to determine whether each pair of elements in list is in order.
  • The ordering function p applied to a pair of elements e1, e2 may return either 1, 0, -1 or True, False. The value of p[e1,e2] is interpreted as follows:
  • 1e1 comes before e2
    0e1 and e2 should be treated as identical
    -1e1 comes after e2
    Truee1 and e2 are in order
    Falsee1 and e2 are out of order

Examples

open allclose all

Basic Examples  (2)

In[1]:=
Click for copyable input
Out[1]=
In[1]:=
Click for copyable input
Out[1]=

Scope  (2)

Generalizations & Extensions  (1)

Applications  (2)

Properties & Relations  (3)

Possible Issues  (1)

See Also

Order  Signature  Sort  Ordering  LongestOrderedSequence  LessEqual

Tutorials

Introduced in 1988
(1.0)
| Updated in 2017
(11.1)