KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a bitboard and I want to check in C if there is ONLY one bit set to 1. #include <stdint.h> typedef uint64_t bboard; bboard b = 0x0000000000000010; if (only_one_bit_set_to_one (b)) // in this example expected true // do something... Any idea to write the function int only_one_bit_set_to_one (bboard b) ?
Tags (comma-separated)
Save Edits
Cancel