Relative Content

Tag Archive for clogicreversebit-shiftmodulo

Shifting a number based on the remainder of it divided by 4 – C

I have a function implemented which reverses the bits in a number. The number of bits in the number to be reversed can vary. However, of course it must be shifted to the left at the end to align with the nibble if it is not divisible by 4. This is what I have :