On this page:
2.12.1 Arithmetic Predicates

2.12 Predicates

In the most usual case, a logical expression is the application of a function to a set of arguments. In this case, the function is known as a predicate: a function that produces only true or false.

2.12.1 Arithmetic Predicates

The mathematical relational operators \(<\),\(>\),\(=\),\(\leq\) and \(\geq\) are some of the most simple predicates. These operators compare numbers. Their use in Julia follows infix notation and are written respectively <,>,==, <= and >=. Some examples are:

> 4 > 3

true

> 4 < 3

false

> 2+3 <= 6-1

true

> 2+3 == 6-1

true

Note that arithmetic equality in Julia uses ==. This is to avoid any confusion with function definitions, which use =.