MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / clearIthBit

Function clearIthBit

CPP/bitmasking/bit-functions.cpp:16–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14 n=(n|mask);
15}
16void clearIthBit(int &n,int i){
17 int mask =~(1<<i);
18 n=n&mask;
19}
20void updateIthBit(int &n,int i,int v){
21 clearIthBit(n,i);
22 int mask=(v<<i);

Callers 1

updateIthBitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected