Compares
x and
y (of the same type), returning
symbol <,
symbol >,
symbol ==, or
incomparable.
Many types of objects may be compared. Numbers are handled as one would expect, and strings, lists and sequences are generally compared lexicographically.
i1 : 3 ? 4
o1 = <
o1 : Keyword
|
i2 : "book" ? "boolean"
o2 = <
o2 : Keyword
|
i3 : 3 ? 3.
o3 = ==
o3 : Keyword
|
i4 : {1,2,3} ? {4,5}
o4 = <
o4 : Keyword
|
Polynomials from the same ring may also be compared. The order depends on the monomial order in the ring.
i5 : R = ZZ[a,b,c]
o5 = R
o5 : PolynomialRing
|
i6 : a*c ? b^2
o6 = <
o6 : Keyword
|
A set is smaller than another if it is a subset; for tallies, corresponding counts should all be smaller.
i7 : set {1,2} ? set {2,3}
o7 = incomparable
o7 : Symbol
|
i8 : set {1,2} ? set {1,2,3}
o8 = <
o8 : Keyword
|
i9 : tally {1,1,2} ? tally {1,2,3}
o9 = incomparable
o9 : Symbol
|
i10 : tally {1,1,2} ? tally {1,1,2,3}
o10 = <
o10 : Keyword
|