3 ms·
0xAAAAAAA5 make a lot more sense as it is a 32 bit integer. Btw it is 36 * 52 * 157109, so not an integer, just like you expected. Then again you don't care abo
by petschge 8y ago
0xAAAAAAA5 make a lot more sense as it is a 32 bit integer.
Btw it is 36 * 52 * 157109, so not an integer, just like you expected. Then again you don't care about that, but the bit pattern.
Any reason why use use 0xAAAAAAA5 instead of 0xAAAAAAAA or 0xA5A5A5A5?
- dragontamer 8y ago> 0xAAAAAAA5 instead of 0xAAAAAAAA or 0xA5A5A5A5? 0xAAAAAAAA isn't odd. Every time you multiply with 0xAAAAAAAA, you lose the top-most bit of your state (alternatively: the bottom-most bit will ALWAYS be zero. So you lost a bit). If you start with 32-bits of entropy, multiplying with 0xAAAAAAAA results with 31-bits of entropy. > 0xA5A5A5A5 That's where statistical tests need to come into the picture, to differentiate. I've written GPGPU programs to brute-force search for constants based on a few metrics. In these brute-force searches, even a simple number like 0xAAAAAAA5 works out decently. Its suboptimal in my experience, but its surprisingly "not bad". My only point is that you shouldn't limit your search to prime numbers. Any odd number works pretty decently as a multiplication constant.