Anonymous user
Integer comparison: Difference between revisions
→{{header|Standard ML}}
Line 1,017:
end
handle Bind => print "Invalid number entered!\n"</lang>
A more idiomatic and less error-prone way to do it in SML would be to use a compare function that returns type <tt>order</tt>, which is either LESS, GREATER, or EQUAL:
<lang sml>fun myCompare (a, b) = case Int.compare (a, b) of
LESS => "A is less than B"
| GREATER => "A is greater than B"
| EQUAL => "A equals B"</lang>
=={{header|Tcl}}==
|