jeudi 1 avril 2021

Does srand() fail? Rand gave me several similar random results

So, I have a code I wrote for my finals, it's basically for generating fractal particles and I use rand() A LOT, and it's a really important part for me. Everything worked fine, I was getting pretty different results but a couple of minutes ago I found some really bad news for me, two exact aggregates, which means that 64+ particles had the same trajectory with random directions(with 0.001 steps it's probably 64.000+ same random inputs), it shouldn't be even statistically possible, so I guess I got the same seed, but how? I use srand(time(NULL)) only when I start my program. Do you have any ideas?




Aucun commentaire:

Enregistrer un commentaire