gmp_randseed()

Torbjorn Granlund tege@swox.com
18 Dec 2002 20:25:05 +0100


bom brill <bombrill_gmp@yahoo.fr> writes:

  I have a real problem understanding the role of the
  gmp_randseed(), and its implementation. 
  In order to understand how does that function works, I
  want to create a program that generates some random
  numbers.
  
  But it doesn t work as I expected. In fact, the
  numbers are always the same !

You seed with the very same value each time, and
therefore get the same sequence of pseudo-random numbers.

Please read the GMP manual about seeding.
It is not going to be easier for you if we repeat the text here.
<http://www.swox.com/gmp/manual/Random-State-Seeding.html#Random%20State%20Seeding>

The GMP manual doesn't give explicit examples of seeding code,
it only gives some examples of seeding sources.

--
Torbjörn