Talk:Linear congruential generator: Difference between revisions

m
Line 17:
It occurs to me that the BSD LCRNG can produce an overflow of 32 bit words. It would be nice to have a sequence that exercises this to ensure the behavior is reproduced. --[[User:Dgamey|Dgamey]] 04:58, 8 July 2011 (UTC)
: Overflow how? Intermediate results can be done with larger integer types. --[[User:Ledrug|Ledrug]] 06:18, 8 July 2011 (UTC)
:: Sure, but in the historical implementations they probably were not done that way. In many similar systems the multiplication would exceed 2^31 and cause an integer overflow. It wouldn't produce an exception but you could suddenly be looking at a negative number. That may not yield the same sequence if you are working with large integers or 64 bit words. --[[User:Dgamey|Dgamey]] 12:28, 8 July 2011 (UTC)
Anonymous user