xlucas wrote:The formula still looks to me like a LCG

You are right, it is.' And &hFFFFFF' will give the same result as 'Mod 2^24'.

Interestingly, Microsoft Visual Basic 6 and earlier uses 43FD43FD and C39EC3 for the multiplier and increment respectively in it's 24 bit generator. counting_pine's multiplier is FD43FD but he did say "something like".

However, I cannot get the VB6 formula to work, yet.

"By the way, is 4294967296 a power of two?"

Yes, 2^32. I was just giving the CPU less work to do.<laugh> So, we could use 'And 4294967295' rather than 'Mod 4294967296'. We cannot use &hFFFFFFFF because that is interpreted as -1.