Compare
How two values of a partially ordered type compare: -1, 0 or 1, or NaN when they are incomparable.
Compare(a, b)How two values of a partially ordered type compare: -1, 0 or 1, or NaN when they are incomparable.Typed signatures
| Type | Package | Applies |
|---|---|---|
(any, any) -> unknown | structures | always |
Details
- The
PartialOrderprotocol's member: a type conforms by saying how it compares two of its values. - Reflexive, antisymmetric and transitive; a
LinearOrdernever answers NaN. - Under dominance, and are incomparable: NaN.
Examples
About
| Examples | 3 |
|---|
See also: Min, Max, GreatestLowerBound