Top "Bitwise-operators" questions

Operators which are used to perform manipulation at bit-level.

Does any language have a unary boolean toggle operator?

So this is more of a theoretical question. C++ and languages (in)directly based on it (Java, C#, PHP) have …

language-agnostic bitwise-operators negation
bitwise-ANDing with 0xff is important?

Doesn't bitwise-ANDing with 0xff essentially mean getting the same value back, for that matter, in this code? byte[] packet = reader.…

java byte bitwise-operators short bitwise-and
Confused by use of double logical not (!!) operator

I have some C++ code that makes extensive use of !!. I'm kinda baffled because as far as I know !! is …

c++ bitwise-operators logical-operators
Xor encryption in PHP

I'm new to Xor encryption, and I'm having some trouble with the following code: function xor_this($string) { // Let's define …

php bitwise-operators xor bitwise-xor
C# bitwise equal bool operator

Boolean in C# are 1 byte variables. And because bool are shortcuts for the Boolean class, I would expect that the &…

c# boolean bitwise-operators boolean-logic
Finding the exponent of n = 2**x using bitwise operations [logarithm in base 2 of n]

Is there a straightforward way to extracting the exponent from a power of 2 using bitwise operations only? EDIT: Although the …

python bit-manipulation primes bitwise-operators logarithm
What is ^0 in golang?

I am seeing ^0 in the code base. Example: type stat struct { ... min int64 ... } newStat := stat{min: ^0} What does ^0 mean?

go bitwise-operators twos-complement