Operators
The shells use arithmetic operators from the C programming language, in decreasing order of precedence.Math Operators
OPERATOR |
DESCRIPTION |
++ −− < /editor query > |
Auto-increment and auto-decrement, both prefix and postfix |
+ |
Unary plus |
− |
Unary minus |
! ~ |
Logical negation; binary inversion (one's complement) |
* / % |
Multiplication; division; modulus (remainder) |
+ − |
Addition; subtraction |
<< >> |
Bitwise left shift; bitwise right shift |
<= >= |
Less than or equal to; greater than or equal to |
< > |
Less than; greater than |
== != |
Equality; inequality (both evaluated left to right) |
& |
Bitwise AND |
^ |
Bitwise exclusive OR |
| |
Bitwise OR |
&& |
Logical AND |
|| |
Logical OR |