Talk:Linear congruential generator: Difference between revisions

(→‎Example Sequences: Overflow is not a problem, if you can do correct math mod 2**31.)
Line 22:
 
::: Overflow is not a problem, if you can do correct math mod 2**31. If you overflow a 32-bit integer, then the low 32 bits should be correct, so you can still take the low 31 bits as the random integer. If you overflow a 10-decimal-digit integer, then you would have a problem, because 10**10 is not a multiple of 2**31. --[[User:Kernigh|Kernigh]] 20:25, 8 July 2011 (UTC)
:::: That is sort of my point. If you do this with 32 bit signed ints you will get a different value that you will in larger ints. For example (BSD)
::::: (32 bits) 0, 12345, 1406932606
::::: (larger ints) 0, 12345, 1406938949
:::: Some implementations may need to address this. That's also why having a common example sequence (with an overflow) is needed. --[[User:Dgamey|Dgamey]] 03:13, 12 July 2011 (UTC)
Anonymous user