Thread: Random numbers
View Single Post
Old 16 November 2020, 15:38   #16
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 48
Posts: 4,146
Quote:
Originally Posted by Thomas Richter View Post
No. The period of a linear congruence random generator does not depend on the seed. It depends on the gcd of the modulo and the multiplier, here 2^32 and, well, the magic number in the code. This number here was not picked at random, so the period is really maximal. It is not in the thousands. Note, however, that this assumes that you pick bits from the MSB on. The period on the LSBs is small.
Well ok, but this has a price : the period of the LSBs is very, very small (lower byte starts to repeat after 256 values !). May make it unsuitable, depending on the needs.
meynaf is offline  
 
Page generated in 0.04164 seconds with 11 queries