Skip to content

Operators

Danger

These operators only work on numerical values. Comparing with a string or any other type will produce an error.

=

Equality operator. Checks whether two values are equal.

1
2
3
4
5
6
7
(= 4 5)

(= "5" 5)

(= 5 5)

(= 5 5.0)
false

Error: "5" is not a malNumber, line: 3

true

true

<

Comparison operator. Checks whether the first value is lesser than the second value.

1
2
3
4
5
(< 4 5)

(< 5 4)

(< 5 5)
true

false

false

>

Comparison operator. Checks whether the first value is greater than the second value.

1
2
3
4
5
(> 4 5)

(> 5 4)

(> 5 5)
false

true

false

<=

Comparison operator. Checks whether the first value is lesser than or equal to the second value.

1
2
3
4
5
(<= 4 5)

(<= 5 4)

(<= 5 5)
true

false

true

>=

Comparison operator. Checks whether the first value is greater than or equal to the second value.

1
2
3
4
5
(>= 4 5)

(>= 5 4)

(>= 5 5)
false

true

true