home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-SSP.ARJ / PORNG.TST < prev    next >
Encoding:
Text File  |  1984-08-31  |  792 b   |  37 lines

  1.         /* General form test program for scientific functions */
  2.  
  3.         /* Routine Tested:  PORNG */
  4.  
  5.         main()
  6.  
  7.        {
  8.         int *fp,i,iflag,l,max;
  9.         float p,r,s[7],y[8],x;
  10.  
  11.         r = 0.6;
  12.         l = 3;
  13.         max = 7;
  14.         iflag = 1;
  15.  
  16.         *fp=fopen("PRN:","w");             /* open the printer */
  17.  
  18.         fprintf(*fp,"Test Results from PORNG\n");
  19.          printf("Test Results from PORNG\n\n");
  20.  
  21.        porng(l,max,iflag,&r,y,s,&x);
  22.  
  23.         fprintf(*fp,"    %15.10f  \n",x);
  24.          printf(   "    %15.10f  \n",x);
  25.  
  26.        iflag = 0;
  27.  
  28.         for(i = 1; i <= 5; i++)
  29.         {
  30.          porng(l,max,iflag,&r,y,s,&x);
  31.  
  32.          fprintf(*fp,"    %15.10f  \n",x);
  33.           printf(   "    %15.10f  \n",x);
  34.         }
  35.        }
  36.  
  37.