Skip to content

Feburary modification of System.Random is non-sensical #88085

Answered by tfenise
Xyncgas asked this question in General
Discussion options

You must be logged in to vote

with probability of the values in this range being equal

This is impossible if one only makes one random ulong and attempts to map it onto [0,s), because however one maps it, the probability of resulting in any particular integer in [0,s) is an integer times 2^(-64), so can never be exactly 1/s unless s is a power of 2.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Xyncgas
Comment options

Answer selected by danmoseley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants