Skip to content
On this page

Comparison operators โ€‹

The comparison operators ==, !=, <, <=, >, >= behave just like in python.

Equal โ€‹

expr1 == expr2
Return True if expr1 is equal to expr2, False otherwise.

Michelson EQ

Not equal โ€‹

expr1 != expr2
Return True if expr1 is not equal to expr2, False otherwise.

Michelson NEQ

Less than โ€‹

expr1 < expr2
Return True if expr1 is less than expr2, False otherwise.

Michelson LT

Less than or equal โ€‹

expr1 <= expr2
Return True if expr1 is less than or equal to expr2, False otherwise.

Michelson LE

Greater than โ€‹

expr1 > expr2
Return True if expr1 is greater than expr2, False otherwise.

Michelson GT

Greater than or equal โ€‹

expr1 >= expr2
Return True if expr1 is greater than or equal to expr2, False otherwise.

Michelson GE

Compare โ€‹

sp.compare(<expr1>,ย <expr2>)
Return 0 if expr1 and expr2 are equal, 1 if expr1 is greater, -1 otherwise.

Michelson COMPARE

Operations โ€‹

Get the minimum of two values โ€‹

sp.min(expr1, expr2)
Return the minimum of expr1 and expr2.

Example โ€‹

python
sp.min(10, 11) # 10

Get the maximum of two values โ€‹

sp.max(expr1, expr2)
Return the maximum of expr1 and expr2.

Example โ€‹

python
sp.max(10, 11) # 11