Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <inttypes.h>
- void rot( uint64_t *i, int n ) {
- uint64_t x = *i;
- uint64_t add = x << (64 - n);
- x = x >> n;
- x = x & add;
- *i = x;
- }
- int main() {
- uint64_t test = 1;
- printf("%d -> ", test);
- rot(&test,1);
- printf("%d\n",test);
- }
Add Comment
Please, Sign In to add comment