MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 127

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

Advertisement

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.
The return value is interpreted as a two's complement number with sign, so the return value
will be an integer in the range -2147483648 to 2147483647.
Availability: ActionScript 1.0; Flash Lite 2.0
Operands
expression1 :
Number
expression2 :
Number
Returns
- The result of the bitwise operation.
Number
Example
In the following example, the integer 1 is shifted 10 bits to the left:
of this operation is
x = 1024
by 10 is 10000000000 binary, and 10000000000 binary is 1024 decimal. In the following
example, the integer 7 is shifted 8 bits to the left:
. This is because 7 decimal equals 111 binary, 111 binary shifted left by 8 bits is
= 1792
11100000000 binary, and 11100000000 binary is 1792 decimal. If you trace the following
example, you see that the bits have been pushed two spaces to the left:
// 2 binary == 0010
// 8 binary == 1000
trace(2 << 2); // output: 8
See also
>>= bitwise right shift and assignment operator
,
operator
<<= bitwise left shift and assignment operator
unsigned right shift operator
assignment operator
- A number or expression to be shifted left.
- A number or expression that converts to an integer from 0 to 31.
. This is because 1 decimal equals 1 binary, 1 binary shifted left
,
>>>= bitwise unsigned right shift and
x = 1 << 10
The result of this operation is
x = 7 << 8
,
>> bitwise right shift
,
The result
>>> bitwise
Operators
127
x

Advertisement

Table of Contents
loading

Table of Contents