EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Bitwise Unsigned Right Shift and Assignment Operator

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Operators 149
Returns
Number - The result of the bitwise operation.
Example
The following example converts -1 to a 32-bit integer and shifts it 1 bit to the right:
var x:Number = -1 >>> 1;
trace(x); // output: 2147483647
This is because -1 decimal is 11111111111111111111111111111111 binary (thirty-two 1s),
and when you shift right (unsigned) by 1 bit, the least significant (rightmost) bit is discarded,
and the most significant (leftmost) bit is filled with a 0. The result is
01111111111111111111111111111111 binary, which represents the 32-bit integer
2147483647.
See also
>>= bitwise right shift and assignment operator
>>>= bitwise unsigned right shift and assignment
operator
expression1 >>>= expression2
Performs an unsigned bitwise right-shift operation and stores the contents as a result in
expression1. The following two statements are equivalent:
A >>>= B;
A = (A >>> B);
Availability: ActionScript 1.0; Flash Player 5
Operands
expression1 : Number - A number or expression to be shifted right.
expression2 : Number - A number or expression that converts to an integer from 0 to 31.
Returns
Number - The result of the bitwise operation.

Table of Contents

Related product manuals