This is the mail archive of the gsl-discuss@sourceware.org mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

rng question


Hi all,

I have question about the random number generator features and documentation.

According to the documentation gsl_rng_max(rng_ returns the maximum random number the underlying rng can give, and gsl_rng_uniform_int(rng,gsl_rng_max(rng)) will return [0,gsl_rng_max(rng)-1]. This will not give the maximum number from the underlying generator, so I tried gsl_rng_uniform_int(rng,gsl_rng_max(rng)+1) but this call does not return (since the second argument becomes 0).

Shouldn't this case be covered by GSL? Either by returning a error code or maybe setting the upper bound to gsl_rng_max(rng) when a 0 second argumnet is given? At least, I think this case should be covered in the documentation.


Cheers,


Jari


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]