AS3: word to the bitwise
Posted: December 23rd, 2008 | Author: Huyen Tue Dao | Filed under: Development | Tags: as3 | No Comments »Oft-forgotten bitwise operators in AS3.
Generally speaking, division and multiplication operations eat up many cycles. If you can replace division with multiplication, then go for it. If you’re doing a lot of integer division or integer multiplication by 2, then go ahead and use the bitwise right shift or left shift, respectively.
Just FYI, in AS3 if you use bitwise operators on Number variables, they are first converted to integers, meaning the decimal portion is truncated.
There’s a lot of other neat tricks you can do with bitwise operators on any platform. Always worth checking out.





Leave a Reply