python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Question about Bitwise Shift in Microsoft C++
I am doing the following bitwise shift in Microsoft C++:
uint8_t arr[3] = {255, 255, 255};
uint8_t value = (arr[1] << 4) >> 4;
The result of these operations confused me quite a bit:
valu...
Runsheng Ma
Votes: 0
Answers: 2
Function in c++ stl that can give me numbers with even number of set bits? Or the code/logic for it?
Is there a built in function in C++ STL that could provide me a list of numbers which have even number of set bits? For example 110 which is 6 has 2 set bits which is even number of set bits. Is there...
Partth Kulkarni
Votes: 0
Answers: 2
My code passes all my tests but some how edabit is not approving it
function bitwiseAND(n1, n2) {
let a = n1.toString(2).padStart(8, "0");
let b = n2.toString(2).padStart(8, "0");
let x = "";
for (let i = 0; i < 8; i++) {
...

PAPPI-HS
Votes: 0
Answers: 1
Why do bitwise 'and', 'xor' and 'or' have different precedences?
What is the reason behind giving &, ^ and | different precedence levels in C? I'm asking for C because most modern languages inherit similar precedence from C. But I don't know much about language...

Sourav Kannantha B
Votes: 0
Answers: 1