# Relational and Logical Operators

 x==y equal (also input as xy) x!=y unequal (also input as x≠y) x>y greater than x>=y greater than or equal to (also input as x≥y) xy>z, etc. strictly decreasing, etc.

Relational operators.

This tests whether 10 is less than 7. The result is False:
 In:= Out= Not all of these numbers are unequal, so this gives False:
 In:= Out= You can mix < and <=:
 In:= Out= Since both of the quantities involved are numeric, the Wolfram Language can determine that this is true:
 In:= Out= The Wolfram Language does not know whether this is true or false:
 In:= Out= !p not (also input as ¬p) p&&q&&… and (also input as p∧q∧…) p||q||… or (also input as p∨q∨…) Xor[p,q,…] exclusive or (also input as p⊻q⊻…) Nand[p,q,…] and Nor[p,q,…] nand and nor (also input as ⊼ and ⊽) If[p,then,else] give then if p is True, and else if p is False LogicalExpand[expr] expand out logical expressions

Logical operations.

Both tests give True, so the result is True:
 In:= Out= You should remember that the logical operations ==, &&, and || are all double characters in the Wolfram Language. If you have used a programming language such as C, you will be familiar with this notation.

The Wolfram Language does not know whether this is true or false:
 In:= Out= The Wolfram Language leaves this expression unchanged:
 In:= Out= You can use LogicalExpand to expand out the terms:
 In:= Out= 