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

Function getValueOfBits

quest/src/core/bitwise.hpp:186–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184
185
186INLINE qindex getValueOfBits(qindex number, int* bitIndices, int numIndices) {
187
188 // bits are arbitrarily ordered, which affects value
189 qindex value = 0;
190
191 for (int i=0; i<numIndices; i++)
192 value |= getBit(number, bitIndices[i]) << i;
193
194 return value;
195}
196
197
198

Calls 1

getBitFunction · 0.85

Tested by

no test coverage detected