/* L-6 MCS 572 Fri 2 Sep 2016 : sprng_seed.c
 * This program illustrates the making of a new seed with each run.
 * In each run of the program, a different random double is shown.  */

#include <stdio.h>

#define SIMPLE_SPRNG
#include "sprng.h"

int main ( void )
{
   printf("SPRNG generates new seed...\n");
   /* make new seed each time program is run   */
   int seed = make_sprng_seed();  
   printf("the seed : %d\n",seed);
   /* initialize the stream */
   init_sprng(seed,0,SPRNG_DEFAULT); 
   double r = sprng();
   printf("a random double: %.15f\n",r);
   return 0;
}
