/* tnorm2.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.) * ------------------------------------------------------------------------ */ /* CCMATH Numerical Analysis Library Test Program Copyright 1993, 1996 by The Calculating Company. All rights reserved. */ /* Test: norm2 setnorm2 Input parameters: s -> unsigned integer: pseudorandom generator seed n -> integer: sample size */ #include "ccmath.h" void main(int na,char **av) { double err[2],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 generator */ setnorm2(s); xm=ssq=0.; for(i=0; i