LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Mersenne Twister pseudorandom number generator under Ubuntu (https://www.linuxquestions.org/questions/programming-9/mersenne-twister-pseudorandom-number-generator-under-ubuntu-4175546903/)

Feed 07-01-2015 05:35 AM

Mersenne Twister pseudorandom number generator under Ubuntu
 
Hello all!
I need to generate Mersenne Twister pseudorandom number generator and
I can't understand how to use /dev/random or /dev/urandom.I guess that is much better than srand(time(NULL))

Thanx!

Varda 07-02-2015 12:41 PM

I think you're correct /dev/random much better than srand.

---------- Post added 07-02-15 at 12:42 PM ----------

Just look here, I guess that it's what you're looking for.

Feed 07-02-2015 12:50 PM

2Varda, Thank you very much!!!
PS
I found this.
You're absolutely right!;)

metaschima 07-03-2015 05:07 PM

What are you going to be using it for ? As it is pseudorandom non-cryptographic, you can just use the system time.

Feed 07-06-2015 06:55 AM

2metaschima
 
I'm not sure that seed generated by this way can be use for generation any random distribution function...Besides, I guess that use native linux feature it's more right approach.

metaschima 07-06-2015 12:45 PM

The output data is definitely going to be randomly distributed, as long as the seed is not the same every time. Using the time or /dev/urandom means that the seed won't be the same every time you run it.


All times are GMT -5. The time now is 02:51 AM.