Boolean operators

The following table shows all the Boolean operators supported by the F# language. Let's take variable X as true and Y as false:

Operator

Description

Example

&&

Boolean AND operator. If both the bool values are true means 1, then the condition is true.

(X && Y) is false

||

Boolean OR operator. If either of the two bool values is true means 1, then the condition is true.

(X || Y) is true

not

Boolean NOT operator. If the condition is true, then the logical NOT operator will become false and vice versa.

not (X && Y) is true

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.