Relational and Logical Operators

Relational operators.

This tests whether 10 is less than 7. The result is (RefLink[False, paclet:ref/False]):

10<7

Not all of these numbers are unequal, so this gives (RefLink[False, paclet:ref/False]):

3!=2!=3

You can mix < and <=:

3<5<=6

Since both of the quantities involved are numeric, the Wolfram Language can determine that this is true:

Pi^E<E^Pi

The Wolfram Language does not know whether this is true or false:

x>y

Logical operations.

Both tests give (RefLink[True, paclet:ref/True]), so the result is (RefLink[True, paclet:ref/True]):

7>4&&2!=3

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:

p&&q

The Wolfram Language leaves this expression unchanged:

(p||q)&&!(r||s)

You can use (RefLink[LogicalExpand, paclet:ref/LogicalExpand]) to expand out the terms:

LogicalExpand[%]