Top "Bit-manipulation" questions

The manipulation of individual bits.

C# bitwise shift on ushort (UInt16)

I need to perform a bitwise left shift on a 16-bit integer (ushort / UInt16), but the bitwise operators in C# …

c# bit-manipulation bitwise-operators 16-bit
How to generate a sse4.2 popcnt machine instruction

Using the c program: int main(int argc , char** argv) { return __builtin_popcountll(0xf0f0f0f0f0f0f0…

gcc optimization bit-manipulation hammingweight
Java integer flag and bitwise operations for memory reduction

Is using an integer flag and bitwise operations an effective way of reducing the memory footprint of high volume Objects? …

java performance memory-management bit-manipulation flags
Bitwise operators and converting an int to 2 bytes and back again

My background is php so entering the world of low-level stuff like char is bytes, which are bits, which is …

c++ bit-manipulation arduino openframeworks
Converting 8 bit color into RGB value

I'm implementing global illumination in my game engine with "reflective shadow maps". RSM has i.a. color texture. To save …

colors bit-manipulation rgb 8-bit
Fastest way to compare bitsets (< operator on bitsets)?

What is the most optimized way to implement a < operator for std::bitset corresponding to the comparison of the …

c++ algorithm c++11 bit-manipulation bitset
Single Number II from leetcode

The question about Single Number II from leetcode is: Given an array of integers, every element appears three times except …

java algorithm bit-manipulation puzzle
What is zero-width bit field

Possible Duplicate: Practical Use of Zero-Length Bitfields Why some structures have zero-width bit fields, and why is it required? struct …

c struct bit-manipulation signed
Need help understanding "getbits()" method in Chapter 2 of K&R C

In chapter 2, the section on bitwise operators (section 2.9), I'm having trouble understanding how one of the sample methods works. Here's …

c operators bit-manipulation bit-shift complement
Hack to convert javascript number to UInt32

Edit: This question is out of date as the Polyfill example has been updated. I'm leaving the question here just …

javascript bit-manipulation operator-keyword indexof uint32