MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / insertBit

Function insertBit

quest/src/core/bitwise.hpp:99–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97
98
99INLINE qindex insertBit(qindex number, int bitIndex, int bitValue) {
100
101 qindex left = getBitsLeftOfIndex (number, bitIndex-1); // include bit at bitIndex
102 qindex right = getBitsRightOfIndex(number, bitIndex);
103 qindex all = concatenateBits(left, bitValue, 1, right, bitIndex);
104 return all;
105}
106
107
108INLINE qindex setBit(qindex number, int bitIndex, int bitValue) {

Calls 3

getBitsLeftOfIndexFunction · 0.85
getBitsRightOfIndexFunction · 0.85
concatenateBitsFunction · 0.85

Tested by

no test coverage detected