J
Joseph
I have following code which I want to generate random numbers of a flat
distribution but something wrong with my code ,it does output in the
range 1-12
========================
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
int main (void)
{
const gsl_rng_type * T;
gsl_rng * r;
r = gsl_rng_alloc (gsl_rng_mt19937);
for (int i = 0; i < 10; i++)
{
double v = gsl_ran_flat(r, 1,12);
printf("number is %d\n ",v);
}
gsl_rng_free (r);
return 0;
}
=========================
is it possible to be the compliation pramater's problem ?
I use: g++ filename -lgsl -lgslcblas -lm
Thanks a lot!!
distribution but something wrong with my code ,it does output in the
range 1-12
========================
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
int main (void)
{
const gsl_rng_type * T;
gsl_rng * r;
r = gsl_rng_alloc (gsl_rng_mt19937);
for (int i = 0; i < 10; i++)
{
double v = gsl_ran_flat(r, 1,12);
printf("number is %d\n ",v);
}
gsl_rng_free (r);
return 0;
}
=========================
is it possible to be the compliation pramater's problem ?
I use: g++ filename -lgsl -lgslcblas -lm
Thanks a lot!!