Top "Bit-manipulation" questions

The manipulation of individual bits.

Understanding PHP & (ampersand, bitwise and) operator

I often use ($var & 1) in my code, which returns true if $var is an odd number and false if …

php operators bit-manipulation bitwise-operators
The difference between logical shift right, arithmetic shift right, and rotate right

I've been reading the classic Hacker's delight and I am having trouble understanding the difference between logical shift right,arithmetic …

bit-manipulation bitwise-operators bit bit-shift
Bit-reverse a byte on 68HC12

I'm in a microprocessors class and we are using assembly language in Freescale CodeWarrior to program a 68HCS12 micro controller. …

assembly bit-manipulation reverse codewarrior 68hc12
What's the function of the ~ bitwise operator (Tilde)

Possible Duplicate: What does this ~ operator mean here? Bit not operation in PHP(or any other language probably) Can someone …

php operators bit-manipulation tilde
Will bit-shift by zero bits work correctly?

Say I have a function like this: inline int shift( int what, int bitCount ) { return what >> bitCount; } It …

c++ bit-manipulation bit-shift
How to set/unset a bit at specific position of a long?

How to set/unset a bit at specific position of a long in Java ? For example, long l = 0b001100L ; // …

java bit-manipulation bitwise-operators
How do I flip a bit in SQL Server?

I'm trying to perform a bitwise NOT in SQL Server. I'd like to do something like this: update foo set …

sql sql-server bit-manipulation
re implement modulo using bit shifts?

I'm writing some code for a very limited system where the mod operator is very slow. In my code a …

c++ optimization bit-manipulation modulo bit-shift
Computing the floor of log₂(x) using only bitwise operators in C

For homework, using C, I'm supposed to make a program that finds the log base 2 of a number greater than 0 …

c bit-manipulation logarithm
Maximum value of unsigned char

#include <stdio.h> int main() { unsigned char i=0x80; printf("%d",i<<1); return 0; } Why does this …

c bit-manipulation unsigned-char