Hi
I have simple c++ code:
g++ -o code code.c on Linux, FreeBSD and OpenBSD.
Results on Linux, run 10 times:
8,5,6,8,8,8,8,4,5,4
8,10,4,6,9,10,5,8,5,10
10,4,4,8,9,9,7,8,10,8
7,9,8,7,4,7,9,6,8,4
8,7,6,6,7,7,4,4,10,9
10,8,5,6,9,10,10,8,10,10
6,7,10,9,9,5,8,9,4,7
6,6,5,4,6,10,4,4,9,4
10,9,5,7,10,8,4,9,7,10
5,9,7,5,8,7,7,6,5,6
And FreeBSD:
7,8,7,8,10,4,6,8,4,5
7,8,9,5,7,9,9,9,5,5
7,7,5,9,4,6,6,9,6,5
7,7,6,8,9,5,8,10,6,5
7,7,8,5,6,10,5,10,7,6
7,7,4,9,10,7,9,4,7,6
7,6,6,6,7,5,6,5,8,6
7,6,9,10,4,9,10,5,8,6
7,6,4,7,8,7,7,6,9,6
7,6,7,4,5,4,4,6,10,6
Why on FreeBSD first number is always the same and second number is changing after +-10sec...?
On OpenBSD, everythik is ok, same as on Linux
I have simple c++ code:
Code:
#include <iostream>
#include <ctime>
#include <cstdlib>
int main() {
srand(time(0));
int a=0;
int s=0;
do {
s=(rand()%7+4);
std::cout<<s<<",";
a++;
} while (a!=10);
return 0;
}
Results on Linux, run 10 times:
8,5,6,8,8,8,8,4,5,4
8,10,4,6,9,10,5,8,5,10
10,4,4,8,9,9,7,8,10,8
7,9,8,7,4,7,9,6,8,4
8,7,6,6,7,7,4,4,10,9
10,8,5,6,9,10,10,8,10,10
6,7,10,9,9,5,8,9,4,7
6,6,5,4,6,10,4,4,9,4
10,9,5,7,10,8,4,9,7,10
5,9,7,5,8,7,7,6,5,6
And FreeBSD:
7,8,7,8,10,4,6,8,4,5
7,8,9,5,7,9,9,9,5,5
7,7,5,9,4,6,6,9,6,5
7,7,6,8,9,5,8,10,6,5
7,7,8,5,6,10,5,10,7,6
7,7,4,9,10,7,9,4,7,6
7,6,6,6,7,5,6,5,8,6
7,6,9,10,4,9,10,5,8,6
7,6,4,7,8,7,7,6,9,6
7,6,7,4,5,4,4,6,10,6
Why on FreeBSD first number is always the same and second number is changing after +-10sec...?
On OpenBSD, everythik is ok, same as on Linux