I have a loop of vb6 code which executes 1,000,000 plus times. Each time the loop is executed a 32 bit random number is generated. Processing time for each loop is about 250 loops per second. Problem is I am ending up with about 30,000 duplicate numbers. My understanding is that the Rnd fucntion uses the system elapsed milliseconds from system start. That should mean that the system "seed" has changed with each loop, but still getting duplicates. example: for i = 1 to 1000000 do a bunch of code get a 32 bit random number using Rnd twice in a function with a Randomize statement before each Rnd do another bunch of code next i
Any ideas? Thanks
vendredi 16 août 2019
Generating a very large number of 32 bit random numbers using vb6
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire