/* L-6 MCS 572 Mon 23 Jan 2012 : 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(0,seed,SPRNG_DEFAULT); 
   double r = sprng();
   printf("a random double: %.15f\n",r);
   return 0;
}

