0

I wrote this :

#include <boost/random.hpp>
#include <boost/random/normal_distribution.hpp>

int main()
{
  boost::mt19937 rng(time(0)); 
  boost::normal_distribution<> nd(0.0, 1.0);

  boost::variate_generator<boost::mt19937&, 
                       boost::normal_distribution<> > var_nor(rng, nd);
 double d = var_nor();
 }

d contains the random numbers I want. How should I do if I need more random numbers LIKE THIS ONE in the same program and in the same cicle for example?! Now I am seeding it with the time of the computer. And I am using the boost library.

schorsch312
  • 5,373
  • 4
  • 25
  • 51
Andrea Angeletti
  • 201
  • 3
  • 12

0 Answers0