Hamster-Scripts: Operators

Overview

Operators Precedence Associativity Data-types
(  )
(highest)
<--
int, str
! ~ + - (unary) .
-->
int
*  /  %
.
<--
int
+  -
.
<--
int, str (+ only)
<<  >>
.
<--
int
<  >  <=  >=
.
<--
int, str
==  =  !=  <>
.
<--
int, str
&
.
<--
int
^
.
<--
int
|
.
<--
int
&&
.
<--
int
||
(lowest)
<--
int

Details

Operators Description
(  )
group
!
logical negation
~
binary negation (complement)
+ (unary)
sign
- (unary)
sign
*
multiplication
/
division
%
modulus
+
addition, string-concatenation
-
subtraction
<<
binary shift left
>>
binary shift right
<
smaller than
>
greater than
<=
smaller or equal
>=
greater or equal
==  =
equal
!=  <>
not equal
&
binary AND
^
binary XOR
|
binary OR
&&
logical AND
||
logical OR

[www.elbiah.de Hamster Playground Documentation]