Next: Boolean Operations, Previous: Operations on A/V Lists, Up: Expressions [Contents][Index]
Comparison expressions compare operands for relationships
such as equality. They return boolean values, i.e. true
or false. The comparison operations are nonassociative,
i.e. they cannot be used together as in:
# Wrong! 1 < $x < 2
Use boolean operations (see Boolean Operations) to group comparisons together.
Comparison operations can only be used in conditional expressions.
This table lists all comparison operators in order from highest precedence to lowest (notice, however, the comment after it):
x = yTrue if x is equal to y. C and AWK
programmers, please note single equal sign!
x != yTrue if x is not equal to y.
x < yTrue if x is less than y.
x <= yTrue if x is less than or equal to y.
x > yTrue if x is greater than y.
x >= yTrue if x is greater than or equal to y.
Operators = and != have equal precedence. Operators
<, <=, >, >= have equal precedence.
Most operators are defined for all radtest data types.
However, only = and != are defined for avlists.
Using any other comparison operator with avlists produces
error.
If x and y are of different data types, their values are first coerced to a common data type, selected using a set of rules (see Conversion Between Data Types).