contents   index   previous   next



Bit operators

 

ScriptEase contains many operators for operating directly on the bits in a byte or an integer. Bit operations require a knowledge of bits, bytes, integers, binary numbers, and hexadecimal numbers. Not every programmer needs to or will choose to use bit operators.

 

<<

shift left

i = i << 2;

<<=

assignment shift left

i <<= 2;

>>

shift right

i = i >> 2;

>>=

assignment shift right

i >>= 2;

>>>

shift left with zeros

i = i >>> 2

>>>=

assignment shift left with zeros

i >>>= 2

&

bitwise and

i = i & 1

&=

assignment bitwise and

i &= 1;

|

bitwise or

i = i | 1

|=

assignment bitwise or

i |= 1;

^

bitwise xor, exclusive or

i = i ^ 1

^=

assignment bitwise xor, exclusive or

i ^= 1

~

Bitwise not, complement

i = ~i;

 


Logical operators and conditional expressions