Operators
List of operators in the Cind language:
operator | arguments | syntax | changes argument | description |
++ | 1 | x++ | yes | increment |
++ | 1 | ++x | yes | increment |
-- | 1 | x-- | yes | decrement |
-- | 1 | --x | yes | decrement |
+ | 2 | x + y | no | addition |
- | 2 | x - y | no | subtraction |
* | 2 | x * y | no | multiplication |
/ | 2 | x / y | no | divistion |
% | 2 | x % y | no | modulo |
! | 1 | !x | no | logical negation |
~ | 1 | ~x | no | ones' complement |
- | 1 | -x | no | unary negation |
< | 2 | x < y | no | less than |
<= | 2 | x <= y | no | less than or equal to |
> | 2 | x > y | no | greater than |
>= | 2 | x >= y | no | greater than or equal to |
== | 2 | x == y | no | equal to |
!= | 2 | x != y | no | not equal to |
&& | 2 | x && y | no | logical and |
|| | 2 | x || y | no | logical or |
& | 2 | x & y | no | bitwise and |
^ | 2 | x ^ y | no | bitwise xor |
| | 2 | x | y | no | bitwise or |
<< | 2 | x << y | no | bitwise left shift |
>> | 2 | x >> y | no | bitwise right shift |
?: | 3 | x ? y : z | no | ternary conditional |
= | 2 | x = y | yes | assignment |
+= | 2 | x += y | yes | assignment by sum |
-= | 2 | x -= y | yes | assignment by difference |
*= | 2 | x *= y | yes | assignment by product |
/= | 2 | x /= y | yes | assignment by quotient |
%= | 2 | x %= y | yes | assignment by remainder |
&= | 2 | x &= y | yes | assignment by bitwise and |
^= | 2 | x ^= y | yes | assignment by bitwise xor |
|= | 2 | x |= y | yes | assignment by bitwise or |
<<= | 2 | x <<= y | yes | assignment by bitwise left shift |
>>= | 2 | x >>= y | yes | assignment by bitwise right shift |
The column "changes argument" says if the first argument is changing during the operation.
For example, an expression
while expression
Operators
what means, that second argument will not be evaluated if the result of whole expression is already known from the value of first argument.
For priority of operators see Priority in expression.
Operations are not an atomic instructions.
For example, instruction