Simple Bitwise - Dividing By Two


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. x = x / 2;
  2. x = x / 64;
  3.  
  4. //equals:
  5. x = x >> 1;
  6. x = x >> 6;

URL: http://lab.polygonal.de/2007/05/10/bitwise-gems-fast-integer-math/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.