Top "Bit-shift" questions

A bit shift operation moves the bits contained in a binary numeral or bit pattern to the left or to the right.

Bitwise shift operators. Signed and unsigned

I'm practising for the SCJP exam using cram notes from the Internet. According to my notes the >> operator …

java bit-shift scjp
LC3 Assembly Bitwise Right Shift

What I need to do it implement both a bitwise left shift, and a bitwise right shift using LC-3 Assembly. …

assembly bitwise-operators bit-shift lc3
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
Right shift and signed integer

On my compiler, the following pseudo code (values replaced with binary): sint32 word = (10000000 00000000 00000000 00000000); word >>= 16; produces a word with …

c++ bit-shift platform-specific
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
Bitwise operators and "endianness"

Does endianness matter at all with the bitwise operations? Either logical or shifting? I'm working on homework with regard to …

c bit-manipulation endianness bit-shift
Converting 16-bit integer to 8-bit integer?

I'm implementing C code to copy a 16-bit sign and magnitude integer to an 8-bit sign and magnitude integer. Is …

bit-shift stdint cstdint uint16 uint8t
Why use the Bitwise-Shift operator for values in a C enum definition?

Apple sometimes uses the Bitwise-Shift operator in their enum definitions. For example, in the CGDirectDisplay.h file which is part …

c enums bitwise-operators bit-shift
When to use Shift operators << >> in C#?

I was studying shift operators in C#, trying to find out when to use them in my code. I found …

c# operators bit-shift
What is the >>>= operator in C?

Given by a colleague as a puzzle, I cannot figure out how this C program actually compiles and runs. What …

c obfuscation literals bit-shift digraphs