News for hackers. Stuff that matters.
Re:Anatomy of a pseudorandom number generator – visualising ... by mistercow on Tuesday July 09, 2013 @01:34AM (#6011256)
Yes, I definitely agree with that, and I don't understand why they did it that way. Generating a float in the [0,1) range by producing decimal digits seems utterly perverse. The sane, naive, and correct way to do it is to generate an integer between 0 and 2^53 and then divide by 2^53.
Re:Anatomy of a pseudorandom number generator – visualising ... by marshray on Tuesday July 09, 2013 @02:05AM (#6011346)
Or use an array of integers 0 <= n < 2^x. Some of the Javascript libraries involved are even using such a format.