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

Actionscript 2.0 language reference
Table of Contents

Advertisement

Returns
- The result of the bitwise operation.
Number
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
. The following two statements are equivalent:
expression1
A >>>= B;
A = (A >>> B);
Availability: ActionScript 1.0; Flash Player 5
Operands
expression1 : Number
expression2 : Number
Returns
- The result of the bitwise operation.
Number
- A number or expression to be shifted right.
- A number or expression that converts to an integer from 0 to 31.
Operators
149

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF