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)
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
How to write/read 8 true/false in a single byte on rust language
Everyone knows that bool uses 1 byte and not 1 bite.
In case I want to store 8 (or more) true/false in a single byte,
how can I do it on Rust?
Something like this:
fn main()
{
let x:ByteOnBits;
...

WORM HACKER
Votes: 0
Answers: 2
Why do operation on <bit> return signed numbers?
Operations like
template< class T >
constexpr int popcount( T x ) noexcept;
return a signed integer, but the number of set bits can never be negative? What was the motivation for choosing a sig...
Mikhail
Votes: 0
Answers: 1
Zero all the bits after the 2nd index
i want to zero all the bits after the 2nd index (Including the 2nd) in an unsigned int. Here's the non working code i wrote so far: (temp is an unsigned int.)
for(int i=2; i< DSLength(dnaS); i++)
...
N.N Beats
Votes: 0
Answers: 1