Integer comparison
var a = read("a: ", Number)
var b = read("b: ", Number)
if (a < b) {
say 'Lower'
}
elsif (a == b) {
say 'Equal'
}
elsif (a > b) {
say 'Greater'
}
Output:
% sidef numcmp.sf
a: 21
b: 42
Lower
var a = read("a: ", Number)
var b = read("b: ", Number)
if (a < b) {
say 'Lower'
}
elsif (a == b) {
say 'Equal'
}
elsif (a > b) {
say 'Greater'
}
% sidef numcmp.sf
a: 21
b: 42
Lower