Wolfram ResearchPRODUCTSPURCHASEFOR USERSCOMPANYOUR SITES
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Previous section-----Next section

A.3.9 Ordering of Expressions

The canonical ordering of expressions used automatically with the attribute Orderless and in functions such as Sort satisfies the following rules:

• Integers, rational and approximate real numbers are ordered by their numerical values.
• Complex numbers are ordered by their real parts, and in the event of a tie, by the absolute values of their imaginary parts.
• Symbols are ordered according to their names, and in the event of a tie, by their contexts.
• Expressions are usually ordered by comparing their parts in a depth-first manner. Shorter expressions come first.
• Powers and products are treated specially, and are ordered to correspond to terms in a polynomial.
• Strings are ordered as they would be in a dictionary, with the upper-case versions of letters coming after lower-case ones. Ordinary letters appear first, followed in order by script, Gothic, double-struck, Greek and Hebrew. Mathematical operators appear in order of decreasing precedence.


Any questions about topics on this page? Click here to get an individual response.Buy NowFree TrialMore Information



 © 2009 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: