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

Function getIntegerFromBits

quest/src/core/bitwise.hpp:360–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358
359
360INLINE qindex getIntegerFromBits(int* bits, int numBits) {
361
362 // first bit is treated as least significant
363 qindex value = 0;
364
365 for (int i=0; i<numBits; i++)
366 value |= bits[i] << i;
367
368 return value;
369}
370
371
372INLINE void getBitsFromInteger(int* bits, qindex number, int numBits) {

Calls

no outgoing calls

Tested by

no test coverage detected