Python uses a big integer internally for integer values. The documentation warns if you are left shifting values that you want constrained to a specific size (e.g. 32 bits), you need to mask them as I've done.Does the code use 32 bit signed integers? 0xffffffff makes me think they're forced to be so, but... well, let's try it and see.
I would suggest you aim to duplicate Joshua Bell's experiment here, which does it with JavaScript: http://calormen.com/tmp/prng/burtle.html
The "nice" thing about using that as a target is that we get to use 64-bit IEEE754 floating point numbers i.e. C doubles. I should ask Joshua to open up his implementation to using those without forcing them to 32 bit values.
I was following the original from the source page which uses 32bit values and two shifts. I'm not sure of the advantage of using 64 bits.
Also as Gist for later reference: https://gist.github.com/tjoneslo/2c3b472f641bab4069b7
Last edited: