Skip to content

Latest commit

 

History

History
35 lines (20 loc) · 535 Bytes

README.md

File metadata and controls

35 lines (20 loc) · 535 Bytes

rotate-bits.h

Build Status

ROT{L,R}{8,16,32,64} macros

Installation

Install with clib

$ clib install jb55/rotate-bits.h

Example

#include "rotate-bits/rotate-bits.h"

int main() {
  unsigned short val = ROTL16(0x8000, 1);
  int tru = val == 1;
}

API

ROT{L,R}{8,16,32,64}(value, rotateN)

  • value: unsigned integer value to rotate

  • rotateN: number of bits to rotate by

License

Public Domain