mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-11 02:09:03 -04:00
Move pseudo RNG seeding to start of application
Also switched to qrand() in place of rand() where possible as it is thread safe. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5716 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
+2
-2
@@ -145,8 +145,8 @@ float gran()
|
||||
* that are inside the unit circle
|
||||
*/
|
||||
do {
|
||||
v1 = 2.0 * (float)rand() / RAND_MAX - 1;
|
||||
v2 = 2.0 * (float)rand() / RAND_MAX - 1;
|
||||
v1 = 2.0 * (float)qrand() / RAND_MAX - 1;
|
||||
v2 = 2.0 * (float)qrand() / RAND_MAX - 1;
|
||||
rsq = v1*v1 + v2*v2;
|
||||
} while(rsq >= 1.0 || rsq == 0.0);
|
||||
fac = sqrt(-2.0*log(rsq)/rsq);
|
||||
|
||||
Reference in New Issue
Block a user