Guest User

Untitled

a guest
Aug 16th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <inttypes.h>
  3.  
  4. void rot( uint64_t *i, int n ) {
  5. uint64_t x = *i;
  6. uint64_t add = x << (64 - n);
  7. x = x >> n;
  8. x = x & add;
  9. *i = x;
  10. }
  11.  
  12. int main() {
  13. uint64_t test = 1;
  14. printf("%d -> ", test);
  15. rot(&test,1);
  16. printf("%d\n",test);
  17. }
Add Comment
Please, Sign In to add comment