# NumericalOrder

NumericalOrder[e1,e2]

gives 1 if e1<e2, -1 if e1>e2, 0 if e1 and e2 are identical or numerically the same and Order[e1,e2] if e1 and e2 are not numerically comparable.

# Details • NumericalOrder provides a general alternative to canonical order in which numeric expressions, dates and Quantity objects are treated by value, but it is otherwise equivalent to canonical order.
• Quantity expressions with compatible units are compared to each other by magnitude after converting them to a common unit.
• DateObject expressions are compared to each other by AbsoluteTime.
• TimeObject expressions are compared by AbsoluteTime.
• NumericalOrder compares inexact numbers using all available significant digits. Unlike Equal, it does not allow any extra tolerance.
• NumericalOrder can be used as an ordering function in functions like Sort, OrderedQ or Ordering.

# Examples

open all close all

## Basic Examples(4)

These two numbers are not ordered:

 In:= Out= These two are numerically the same:

 In:= Out= Compare numeric expressions:

 In:= Out= This is not always the same as the canonical order of expressions:

 In:= Out= Compare quantities:

 In:= Out= Compare dates:

 In:= Out= ## Possible Issues(1)

Introduced in 2017
(11.1)