understanding constant in /2018/07/02/cracktrunc.c
https://github.com/lemire/Code-used-on-Daniel-Lemire-s-blog/blob/master/2018/07/02/cracktrunc.c
I found the blog quite ineteresting, and it helped me quite a bit in coming up with a solution for a problem I was working on. There's one bit of confusion though. In the code you do the following:
```C
uint64_t fullmult = low + ((uint64_t)output1 << 32);
uint64_t reversedstate = 0x95c11c128eba7c7d * fullmult;
uint64_t pristine = reversedstate;
```
I don't understand where that magic number in the calculation for `reversedstate` comes from? Is the assumption that the constant in the `xorshift` function is arbitrary leading me to not understand this?
关闭于 2023-12-04 2 条评论