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

Function setBits

quest/src/core/bitwise.hpp:174–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172
173
174INLINE qindex setBits(qindex number, int* bitIndices, int numIndices, qindex bitsValue) {
175
176 // bitIndices are arbitrarily ordered, which does not affect number
177 for (int i=0; i<numIndices; i++) {
178 int bit = getBit(bitsValue, i);
179 number = setBit(number, bitIndices[i], bit);
180 }
181
182 return number;
183}
184
185
186INLINE qindex getValueOfBits(qindex number, int* bitIndices, int numIndices) {

Calls 2

getBitFunction · 0.85
setBitFunction · 0.70

Tested by

no test coverage detected