Closed xvxx closed 5 years ago
Maybe the seed is constant by accident? I get the same results each time, it seems:
$ cat rand.ldpl DATA: r is number i is number PROCEDURE: while i is less than 5 do store random in r display r crlf incr i repeat
$ for i in {1..5}; do echo "# ${i}"; ./rand-bin; done # 1 0.365382414946976 0.982248013830859 0.642368455250919 0.28662740219693 0.346748723809956 # 2 0.365382414946976 0.982248013830859 0.642368455250919 0.28662740219693 0.346748723809956 # 3 0.365382414946976 0.982248013830859 0.642368455250919 0.28662740219693 0.346748723809956 # 4 0.365382414946976 0.982248013830859 0.642368455250919 0.28662740219693 0.346748723809956 # 5 0.365382414946976 0.982248013830859 0.642368455250919 0.28662740219693 0.346748723809956
It seems that the problem is that std::time has a resolution on seconds.
There, it's fixed now using the C++11 header.
Works great! :+1:
Awesome! :smile:
Maybe the seed is constant by accident? I get the same results each time, it seems: