The comparison commands compare values for equality or inequality using the standard ordering rules. These commands make extensive use of both scalar and transitive extension
In some cases, it is desirable to compare two values which may
or may not be lists and scalar extension is undesirable. In this
case, wrap both arguments in a box (⊂
) before
calling the comparison. To put the top two arguments in a box,
the following snippet may be used.
Comparing two lazy lists may hang, if both are infinite and the comparison cannot be determined from a finite prefix.
`⊂↘
=
)Determines whether the two arguments are equal. Subject to scalar and transitive extension.
<
)Determines whether the first argument is less than the second. Subject to scalar and transitive extension.
>
)Determines whether the first argument is greater than the second. Subject to scalar and transitive extension.
≤
)Determines whether the first argument is less than or equal to the second. Subject to scalar and transitive extension.
≥
)Determines whether the first argument is greater than or equal to the second. Subject to scalar and transitive extension.
≠
)Checks whether the two arguments are not equal. Subject to scalar and transitive extension.
≡
)
Checks whether the two arguments are equal. Subject to
transitive extension. This behaves identically to =
but
does not perform scalar extension.
≢
)
Checks whether the two arguments are not equal. Subject to
transitive extension. This behaves identically to ≠
but
does not perform scalar extension.
🧭
)Compares the two arguments and returns -1 if the former is less, 1 if the latter is less, and 0 if the two are equal. If the values are non-comparable, raises an error. Subject to scalar extension but not transitive extension.
⌈
)
Takes two arguments and returns whichever is larger. Subject to
scalar and binary extension. If used with a prime
modifier, this command first pops a function, which is used instead of the standard <
for
comparison. If given a numerical modifier of zero, this command pushes -∞
.
⌊
)
Takes two arguments and returns whichever is smaller. Subject to
scalar and binary extension. If used with a prime
modifier, this command first pops a function, which is used instead of the standard <
for
comparison. If given a numerical modifier of zero, this command pushes ∞
.