The following table shows all the comparison operators supported by F# . These operators return true or false.
Let's take X = 20 and Y = 30:
Operator |
Description |
Example |
== |
Verifies the values of two variables are equal; if not, then the condition becomes false. |
(X == Y) returns false |
<> |
Verifies the values of two variables are equal; if values are not equal then the condition becomes true. |
(X <> Y) returns true |
> |
Verifies the value of the left variable is greater than the value of the right variable; if not, then the condition becomes false. |
(X > Y) returns false |
< |
Verifies the value of the left variable is less than the value of the right variable; if yes, then the condition becomes true. |
(X < Y) returns true |
>= |
Verifies the value of the left variable is greater than or equal to the value of the right variable; if not, then condition becomes false. |
(X >= Y) returns false |
<= |
Verifies the value of the left variable is less than or equal to the value of the right variable; if yes, then the condition becomes true. |
(X <= Y) returns true |