Revert "Seeding the PRNG on every call to it."
This reverts commit 7168ee91de
.
This commit is contained in:
@@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include "mathutil.h"
|
#include "mathutil.h"
|
||||||
|
|
||||||
//minmax, move_to_zero and ex_abs (return absolute value) are templates in the header file
|
//minmax, move_to_zero and ex_abs (return absolute value) are templates in the header file
|
||||||
|
|
||||||
short get_ran (short times,short min,short max){
|
short get_ran (short times,short min,short max){
|
||||||
long int store;
|
long int store;
|
||||||
@@ -18,7 +18,6 @@ short get_ran (short times,short min,short max){
|
|||||||
if(max < min) max = min;
|
if(max < min) max = min;
|
||||||
|
|
||||||
for (i = 1; i < times + 1; i++) {
|
for (i = 1; i < times + 1; i++) {
|
||||||
srand(GetTickCount());
|
|
||||||
store = rand();
|
store = rand();
|
||||||
to_ret += min + (store % (max - min + 1));//min + (((store + 32767) * (max - min + 1)) / 65536);
|
to_ret += min + (store % (max - min + 1));//min + (((store + 32767) * (max - min + 1)) / 65536);
|
||||||
}
|
}
|
||||||
@@ -54,4 +53,4 @@ short gcd(short a, short b){ // Grabbed from Wikipedia and translated to C code
|
|||||||
a = t;
|
a = t;
|
||||||
}
|
}
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user