Programming/Function [Function] getBits(unsigned int x, int p, int n): get n bits from position p 숫눈길 2017. 8. 6. 22:16 /* getBits: get n bits from position p */ unsigned getBits(unsigned int x, int p, int n) { return ((x >> (p + 1 - n)) & ~((~0) << n)); } 저작자표시 (새창열림)