/* tunfl2.c CCMATH mathematics library source code. * * Copyright (C) 2000 Daniel A. Atkinson All rights reserved. * This code may be redistributed under the terms of the GNU library * public license (LGPL). ( See the lgpl.license file for details.) * ------------------------------------------------------------------------ */ /* Test: unfl2() setunfl2() Input parameters: s -> unsigned integer: pseudorandom seed n -> integer: sample size */ #include #include "ccmath.h" void main(int na,char **av) { double x,xm,ssq; unsigned int s; int n,i,p; if(na!=3){ printf("para: seed(hex) size\n"); exit(-1);} sscanf(*++av,"%x",&s); n=atoi(*++av); printf(" seed= %x\n",s); printf(" sample size= %d\n",n); if(n>1000) p=0; else p=1; /* initialize pseudorandom uniform generator */ setunfl2(s); xm=ssq=0.; for(i=0; i