Bit twiddling hacks for JavaScript
npm install bit-twiddlebit-twiddle
===========
This is a collection of miscellaneous bit twiddling hacks ported to JavaScript, mostly taken from here:
* Stanford Bit Twiddling Hacks


Install
=======
Via npm:
npm install bit-twiddle
true if v is a power of 2, otherwise false.``javascript`
deinterleave2(interleave2(x,y), 0) === x
deinterleave2(interleave2(x,y), 1) === y
$3
Interleaves a triple of 10 bit integers. Useful for fast octree indexing.
Acknowledgements
================
Code is ported from Sean Eron Anderson's public domain bit twiddling hacks page. http://graphics.stanford.edu/~seander/bithacks.html
JavaScript implementation (c) 2013 Mikola Lysenko. MIT License