Status: New
Owner: ----

New issue 3127 by [email protected]: Math.random RNG bias
http://code.google.com/p/v8/issues/detail?id=3127

Tried this repeatedly in d8 [version 3.21.17], nodejs 0.10.25 and various versions of google chrome:

d8> Array.apply(null, Array(10000)).reduce(function(a){ return a + (Math.floor(Math.random() * (Math.pow(2,33) + 1)) % 2)}, 0)
    0

This does not appear to be a sign / integer overflow issue, given that each value is nonnegative:

d8> Array.apply(null, Array(10000)).reduce(function(a){ return a + ((Math.floor(Math.random() * (Math.pow(2,33) + 1)) % 2)<0?1:0)}, 0)
    0

Writing out each number in a sample run, every sample has even integral part

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to