Wilang Documentation1.0.0+4

compareNatural#

Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.

Available in: math cells, REPL.

Syntax#

compareNatural(x, y)

Arguments and behavior#

Arguments must match one of the syntax forms above. Use the example as a starting point; arrays and numeric types are accepted only by compatible overloads. The example returns scalar (number).

Example#

Edit the inputs, then use Run or Reset. Changes stay in this example.

Example
compareNatural(2, 3)

Expected result: -1.

See also#

equal · unequal · smaller · smallerEq · largerEq · compare · compareText

All functions · Math guides