SLB |
|
Simple Load Balancer |
Sergey Poznyakoff |
SLB User Manual (split by node): | ? |
True if a equals b
True if the operands are not equal.
True if a is less than b.
True if a is less than or equal to b.
True if a is greater than b.
True if a is greater than or equal to b.
True if expr is false.
Logical and: true if both a and b are true, false otherwise.
Logical or: true if at least one of a or b are true.
Both logical ‘and’ and ‘or’ implement boolean shortcut evaluation: their second argument (b) is evaluated only when the first one is not sufficient to compute the result.
The following table lists all operators in order of decreasing precedence:
Operators | Description |
---|---|
(...) | Grouping |
? | Ternary operator |
** | Power (right-associative) |
- | Unary negation |
* / | Multiplication, division |
+ - | Addition, subtraction |
< <= >= > | Relational operators (non-associative) |
== != | Equality comparison (non-associative) |
! | Boolean negation |
&& | Logical ‘and’. |
|| | Logical ‘or’ |
When operators of equal precedence are used together they are evaluated from left to right (i.e., they are left-associative), except for comparison operators, which are non-associative and for the power operator, which is right-associative (these are explicitly marked as such in the above table). This means, for example that you cannot write:
(5 <= x <= 10) ? x : y |
Instead, you should write:
(5 <= x && x <= 10) ? x : y |
SLB User Manual (split by node): | ? |
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.