bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] gsl_rng_uniform_pos generates boundary value


From: Giorgos
Subject: [Bug-gsl] gsl_rng_uniform_pos generates boundary value
Date: Thu, 18 Oct 2012 23:54:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1

Hello,

According to the GSL documentation, the gsl_rng_uniform_pos call should not return a boundary value (0 or 1). However, I noticed that for a given state of the RNG it generates the value 1.0. I have saved the RNG state in a file which I attach here, but I am not sure whether it is portable... Here is the program to generate the uniform

#include <stdio.h>
#include <gsl/gsl_randist.h>

int main()
{
  FILE * seed = fopen("seed", "r");
  gsl_rng * RNG = gsl_rng_alloc(gsl_rng_mt19937);
  gsl_rng_fread(seed, RNG);

  printf("%f\n", gsl_rng_uniform(RNG));

  return 0;
}

I use GSL-1.15, GCC-4.7. If you would like me to give any more information, please ask :)


Attachment: seed
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]