sharase / melg-64

Implementing 64-bit Maximally Equidistributed F2-Linear Generators with Mersenne Prime Period
MIT License
12 stars 2 forks source link

Initialization of Melg607 by array #2

Closed fabienlefloch closed 3 years ago

fabienlefloch commented 4 years ago

Line 80 of melg607-64.c reads melg[0] = (melg[0] || (1L << 63));

This means that melg[0]=1, always. It looks like a typo in the code. Should it be melg[0] = (melg[0] | (1L << 63)); instead?

fabienlefloch commented 4 years ago

This also applies to all others melgXXX-64.c code.

sharase commented 4 years ago

Thank you for your nice comment. Exactly! These are typos, and your suggestion is right. This line means the avoidance of the all-zero state, but I feel that these bugs have little effect on the pseudorandom number generation in practice.

Anyway, together with Vigna's suggestion, I will fix this initialization as soon as possible. Recently, I am busy to prepare online courses at university because of COVID-19, so please wait a minute.

sharase commented 3 years ago

I fixed it. Please let me know if you have any problems.