Enigma is using bad random numbers

Message boards : Number crunching : Enigma is using bad random numbers

To post messages, you must log in.

AuthorMessage
blub

Send message
Joined: 17 May 14
Posts: 7
Credit: 1,148,101
RAC: 0
Message 3617 - Posted: 20 Oct 2015, 16:15:00 UTC

just found this great line of code in the Enigma source:
i = rand() % (count+1);


1: this does not produce a unifor distribution in [0:count]
2: rand produces very poor output
ID: 3617 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote
numbermaniac

Send message
Joined: 28 Mar 14
Posts: 4
Credit: 11,545
RAC: 0
Message 3631 - Posted: 25 Oct 2015, 23:58:50 UTC - in response to Message 3617.  

This is more like finding the modulus of randomly generated numbers. I'm not sure how the rest of this works, but that doesn't look too bad...
ID: 3631 · Rating: 0 · rate: Rate + / Rate - Report as offensive    Reply Quote

Message boards : Number crunching : Enigma is using bad random numbers




Copyright © 2017 TJM