Bitwise Unsigned Right Shift Operator - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

string result = (lsb ? "1" : "0")+result;
// Shift numberToConvert right by one bit, to see next bit
numberToConvert >>= 1;
}
return result;
}
trace(convertToBinary(479));
// Returns the string 00000000000000000000000111011111
// This string is the binary representation of the decimal
// number 479
See also
>> bitwise right shift operator
>>> bitwise unsigned right shift operator
expression1 >>> expression2
The same as the bitwise right shift (
original
expression
Floating-point numbers are converted to integers by discarding any digits after the decimal
point. Positive integers are converted to an unsigned hex value with a maximum value of
4294967295 or 0xFFFFFFFF; values larger than the maximum have their most significant
digits discarded when they are converted so the value is still 32-bit. Negative numbers are
converted to an unsigned hex value via the two's complement notation, with the minimum
being -2147483648 or 0x800000000; numbers less than the minimum are converted to two's
complement with greater precision and also have the most significant digits discarded.
Availability: ActionScript 1.0; Flash Lite 2.0
Operands
expression1 :
Number
expression2 :
Number
and 31.
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
134
ActionScript language elements
) operator except that it does not preserve the sign of the
>>
because the bits on the left are always filled with 0.
- A number or expression to be shifted right.
- A number or expression that converts to an integer between 0

Advertisement

Table of Contents
loading

Table of Contents