Gang Of Coders
Home
About Us
Contact Us
All Bit Manipulation Solutions on Gang of Coders
Total of 90 Bit Manipulation Solutions
How does this bitwise operation check for a power of 2?
C
Math
Bit Manipulation
Extracting bits with a single multiplication
C
Multiplication
Bit Manipulation
In Java, how to get positions of ones in reversed binary form of an integer?
Java
Binary
Bit Manipulation
Algorithm to generate bit mask
C
Algorithm
Bit Manipulation
Two's Complement Binary in Python?
Python
Binary
Bit Manipulation
Can XOR of two integers go out of bounds?
C++
C
Bit Manipulation
Integer Overflow
Bitwise Xor
How to add two numbers without using ++ or + or another arithmetic operator
C++
C
Algorithm
Bit Manipulation
Two elements in array whose xor is maximum
Arrays
Algorithm
Bit Manipulation
Xor
Efficient way to OR adjacent bits in 64-bit integer
C++
Bit Manipulation
How to define and work with an array of bits in C?
C
Arrays
Multidimensional Array
Bit Manipulation
Bitarray
Add two integers using only bitwise operators?
C#
Bit Manipulation
Division without using '/'
Algorithm
Bit Manipulation
Division
Checking flag bits java
Java
Bit Manipulation
Flags
Bitwise operations on 32-bit unsigned ints?
Javascript
Bit Manipulation
What does AND 0xFF do?
C
Bit Manipulation
Bitwise Operators
Bit Shift
Absolute value abs(x) using bitwise operators and Boolean logic
C++
C
Bit Manipulation
Language Lawyer
Absolute Value
Unsigned Integer in Javascript
Javascript
Bit Manipulation
Unsigned
How does this work? Weird Towers of Hanoi Solution
Algorithm
Language Agnostic
Bit Manipulation
Towers of-Hanoi
Bitfield manipulation in C
C
Bit Manipulation
Efficient Algorithm for Bit Reversal (from MSB->LSB to LSB->MSB) in C
C
Algorithm
Bit Manipulation
What is Bit Masking?
C
Bit Manipulation
Bitwise Operators
Terminology
Bitmask
Rounding up to next power of 2
C
Optimization
Bit Manipulation
Using bitwise OR 0 to floor a number
Javascript
Floating Point
Bit Manipulation
How to count the number of set bits in a 32-bit integer?
Algorithm
Binary
Bit Manipulation
Hammingweight
Iec10967
What does a tilde do when it precedes an expression?
Javascript
Syntax
Bit Manipulation
Most common C# bitwise operations on enums
C#
.Net
Enums
Bit Manipulation
Flags
C# int to byte[]
C#
.Net
Bit Manipulation
Nfs
What is the meaning of double tilde (~~) in Java?
Java
Gwt
Bit Manipulation
Bitwise Operators
Explain the use of a bit vector for determining if all characters are unique
Java
String
Bit Manipulation
Bitvector
What does (x ^ 0x1) != 0 mean?
C++
C
Bit Manipulation
Bitmask
'and' (boolean) vs '&' (bitwise) - Why difference in behavior with lists vs numpy arrays?
Python
Numpy
Bit Manipulation
Boolean Expression
Ampersand
Why is XOR the default way to combine hashes?
Cryptography
Bit Manipulation
Hash
Probability
Xor
How can I remove a flag in C?
C
Bit Manipulation
Flags
Are the shift operators (<<, >>) arithmetic or logical in C?
C
Binary
Bit Manipulation
Bit Shift
~x + ~y == ~(x + y) is always false?
C
Bit Manipulation
Signed
Twos Complement
How do you set, clear, and toggle a single bit?
C++
C
Bit Manipulation
Bitwise Operators
What is the fastest/most efficient way to find the highest set bit (msb) in an integer in C?
C
Algorithm
Optimization
Bit Manipulation
What is the idea behind ^= 32, that converts lowercase letters to upper and vice versa?
C++
Bit Manipulation
Ascii
Why does this random value have a 25/75 distribution instead of 50/50?
Java
Random
Double
Bit Manipulation
Probability
Position of least significant bit that is set
C++
C
Optimization
Bit Manipulation
In C/C++ what's the simplest way to reverse the order of bits in a byte?
C++
C
Bit Manipulation
Should I use #define, enum or const?
C++
Enums
Bit Manipulation
C Preprocessor
How do I get bit-by-bit data from an integer value in C?
C
Bit Manipulation
C/C++ check if one bit is set in, i.e. int variable
C++
C
Bit Manipulation
Best practices for circular shift (rotate) operations in C++
C++
C
Rotation
Bit Manipulation
C++ Faq
How do I write a maintainable, fast, compile-time bit-mask in C++?
C++
C++11
Bit Manipulation
Bitwise operation and usage
Python
Binary
Operators
Bit Manipulation
What is CHAR_BIT?
C
Bit Manipulation
How can I test whether a number is a power of 2?
C++
Algorithm
Bit Manipulation
How can I multiply and divide using only bit shifting and adding?
C
Assembly
Bit Manipulation
Division
Multiplication
What is “2's Complement”?
Binary
Bit Manipulation
Computer Science
Twos Complement
Data Representation
Precedence and bitmask operations
Php
Bit Manipulation
Bitwise Operators
Operator Precedence
C/C++: Force Bit Field Order and Alignment
C++
C
Bit Manipulation
Endianness
Bit
How do you set, clear and toggle a single bit in JavaScript?
Javascript
Numbers
Bit Manipulation
Manipulate alpha bytes of Java/Android color int
Java
Android
Bit Manipulation
Saturating subtract/add for unsigned bytes
C++
C
Optimization
Bit Manipulation
Saturation Arithmetic
Set specific bit in byte
Java
Byte
Bit Manipulation
Why if (n & -n) == n then n is a power of 2?
Java
Logic
Bit Manipulation
How do I flip a bit in SQL Server?
Sql
Sql Server
Bit Manipulation
Have you ever had to use bit shifting in real projects?
Bit Manipulation
Bit Shift
Efficiently find binary strings with low Hamming distance in large set
Algorithm
Bit Manipulation
Bitwise Operators
Hamming Distance
Is there an elegant and fast way to test for the 1-bits in an integer to be in a contiguous region?
C++
C
Bit Manipulation
Two's Complement in Python
Python
Bit Manipulation
Twos Complement
bit-wise operation unary ~ (invert)
Python
Bit Manipulation
Incrementing 'masked' bitsets
C++
C
Bit Manipulation
Intrinsics
How does XOR variable swapping work?
Language Agnostic
Bit Manipulation
Xor
Bitwise operators and "endianness"
C
Bit Manipulation
Endianness
Bit Shift
Catch and compute overflow during multiplication of two large integers
C
Integer
Bit Manipulation
Multiplication
Integer Overflow
Explain this snippet which finds the maximum of two integers without using if-else or any other comparison operator?
C
Algorithm
Math
Bit Manipulation
Max
Subtracting packed 8-bit integers in an 64-bit integer by 1 in parallel, SWAR without hardware SIMD
C++
C
Bit Manipulation
Simd
Swar
Given an integer, how do I find the next largest power of two using bit-twiddling?
Language Agnostic
Bit Manipulation
Simplest way to check if two integers have same sign?
Integer
Bit Manipulation
Sign
What does bitwise XOR (exclusive OR) mean?
Math
Language Agnostic
Bit Manipulation
Operators
Xor
What USEFUL bitwise operator code tricks should a developer know about?
Language Agnostic
Bit Manipulation
Bit
What are bitwise shift (bit-shift) operators and how do they work?
Language Agnostic
Bit Manipulation
Operators
Bit Shift
Binary Operators
Is shifting bits faster than multiplying and dividing in Java? .NET?
C#
Java
.Net
Optimization
Bit Manipulation
Checking if a bit is set or not
C#
.Net
Bit Manipulation
warning: left shift count >= width of type
C
Bit Manipulation
Long Integer
Bit Shift
Arithmetic bit-shift on a signed integer
C
Bit Manipulation
Bit Shift
Understanding PHP & (ampersand, bitwise and) operator
Php
Operators
Bit Manipulation
Bitwise Operators
What does a bitwise shift (left or right) do and what is it used for?
Bit Manipulation
Bitwise Operators
Bit Shift
Implement division with bit-wise operator
Bit Manipulation
Bit
What is (x & 1) and (x >>= 1)?
C++
Bit Manipulation
Bitwise Operators
Bit Shift
Bitwise And
Is there an elegant way to Invert a Bit value in an SQL insert Statement?
Sql
Sql Server
Bit Manipulation
get absolute value without using abs function nor if statement
C++
C
Bit Manipulation
Android In App Billing: securing application public key
Android
Security
Bit Manipulation
In App-Billing
Public Key
Bitwise operator for simply flipping all bits in an integer?
Java
Binary
Bit Manipulation
Bit
Bitwise Operators
Fast computing of log2 for 64-bit integers
C
64 Bit
Bit Manipulation
32bit 64bit
Lookup
Fast way to generate pseudo-random bits with a given probability of 0 or 1 for each bit
C++
C
Algorithm
Random
Bit Manipulation
BitSet to and from integer/long
Java
Bit Manipulation
Bitset