| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Basic operators in Bunao usually operate the way you'd expect them to. For users coming from outside the C style operator syntax (C, C++, Perl, Tcl, Java, etc), the most important exceptions are:
The full list of logical and arithmetic operators and their precedence values follows:
| Symbol | Prec | Description |
- |
1 | unary minus (like -3) |
! |
1 | logical not |
* |
2 | multiplication |
/ |
2 | division |
% |
2 | modulus |
+ |
3 | addition |
- |
3 | subtraction |
< |
5 | less |
> |
5 | greater |
<= |
5 | less or equal |
>= |
5 | greater or equal |
== |
6 | equal |
!= |
6 | not equal |
&& |
10 | logical and |
|| |
11 | logical or |
Bunao also supports the following operators:
~ |
1 | bitwise not |
<< |
4 | bitwise shift left |
>> |
4 | bitwise shift right |
& |
7 | bitwise and |
^ |
8 | bitwise xor |
| |
9 | bitwise or |
x?y:z |
12 | if x then y else z |