Mathematica 9 is now available
 Documentation / Mathematica / Built-in Functions / Lists and Matrices / Structure Manipulation  /
Order

  • Order[ , ] gives 1 if is before in canonical order, and -1 if is after in canonical order. It gives 0 if is identical to .
  • Examples: Order[a, b]; Order[b, a].
  • Order uses canonical order as described in the notes for Sort.
  • See the Mathematica book: Section 2.2.10.
  • See also: Equal, SameQ, Sort.

    Further Examples

    Mathematica puts lower-case expressions before upper-case expressions that start with the same letter.

    In[1]:=

    Out[1]=

    Shorter expressions come before longer expressions.

    In[2]:=

    Out[2]=



    Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
    THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
    SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.