An example of it being used is here
boundsCentre = new Vector3D(stageWidth >> 1,stageHeight >> 1, 200.0);
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
>>is the right bit-shifting operator.a >> bwill shifta‘s bit valuesbbits to the right.if
a = 8andb = 2,a >> bwill produce2becauseais represented by1000, shifted 2 places is10which represents2in binary.More importantly, because ActionScript is an ECMAScript variant, values of type
Numberwill be converted from a 64-bit representation to a 32-bit representation and then shifted. Additionally, (AFAIK, can’t seem to find it in the reference) bit-shift overflows are undefined in ECMAScript.stageWidth >> 1essentially divides the stageWidth by 2, which means it’s a vector to the center of the stage. In other languagesx >> 1is a faster method of division by 2, but in ECMAScript, there is no significant performance change, and the possibility of ambiguity. Because of this it is better to just code the desired effect as:It is much more understandable that way.