Skip to content Skip to sidebar Skip to footer
Showing posts with the label Bit Manipulation

How To Read Off 1 Flag Bit And Get Integer At Same Time

Say I have an 8-bit number with a flag at either side: 0101011 (decimal 43) 0101011 (decimal 43) … Read more How To Read Off 1 Flag Bit And Get Integer At Same Time

Method Implementation That Takes 3 Parameters And Returns A Binary Number

I found a method that converts 1 number to a binary number. function dec2bin(dec){ return (dec … Read more Method Implementation That Takes 3 Parameters And Returns A Binary Number

2.9999999999999999 >> .5?

I heard that you could right-shift a number by .5 instead of using Math.floor(). I decided to check… Read more 2.9999999999999999 >> .5?

JavaScript Endian Encoding?

A response on SO got me thinking, does JavaScript guarantee a certain endian encoding across OSs an… Read more JavaScript Endian Encoding?