Comparison operators

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 ...

Get .NET Core 2.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.