__rand48_step.c 285 B

12345678910111213
  1. #include <stdint.h>
  2. uint64_t __rand48_step(unsigned short *xi, unsigned short *lc)
  3. {
  4. uint64_t a, x;
  5. x = xi[0] | xi[1]+0U<<16 | xi[2]+0ULL<<32;
  6. a = lc[0] | lc[1]+0U<<16 | lc[2]+0ULL<<32;
  7. x = a*x + lc[3];
  8. xi[0] = x;
  9. xi[1] = x>>16;
  10. xi[2] = x>>32;
  11. return x & 0xffffffffffffull;
  12. }