local n = 509
n = bit.bxor(n*(2^13), n)
return ( 1.0 - bit.band((n * (n * n * 15731 + 789221) + 1376312589), 0x7fffffff) / (2*1073741824.0))
bit.band should give 1463304111 (it's what it gives in lua5.2 standalone with the bit32 module) but it's giving 0 instead
so the function is giving 1 instead of 0.3185...
n = bit.bxor(n*(2^13), n)
return ( 1.0 - bit.band((n * (n * n * 15731 + 789221) + 1376312589), 0x7fffffff) / (2*1073741824.0))
bit.band should give 1463304111 (it's what it gives in lua5.2 standalone with the bit32 module) but it's giving 0 instead
so the function is giving 1 instead of 0.3185...