home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-SSP.ARJ / STANVB.TST < prev    next >
Encoding:
Text File  |  1984-09-02  |  1.1 KB  |  44 lines

  1.         /* General form test program for scientific functions */
  2.  
  3.         /* Routine Tested:  STANVB  */
  4.  
  5.         main()
  6.  
  7.     {
  8.         int *fp,i,lcx,lcn,nb,nt,nr,ntb;
  9.         static int n[16]={1,0,1,1,
  10.                           0,1,1,1,
  11.                           1,1,1,0,
  12.                           1,1,0,1};
  13.  
  14.         float av[13],f,g[4];
  15.         static float x[16]={2., 0.,20., 7.,
  16.                             0.,32.,14., 3.,
  17.                             4.,13.,31., 0.,
  18.                             0.,23., 0.,11.};
  19.  
  20.         lcx = 4;
  21.         lcn = 4;
  22.         nb = 4;
  23.         nt = 4;
  24.         nr = 3;
  25.         ntb = 3;
  26.  
  27.        stanvb(lcx,lcn,nb,nt,ntb,nr,n,x,&f,av,g);
  28.  
  29.         *fp=fopen("PRN:","w");             /* open the printer */
  30.  
  31.         fprintf(*fp,"Test Results from STANVB\n");
  32.          printf("Test Results from STANVB\n\n");
  33.  
  34.         fprintf(*fp,"   F =  %f\n\n",f);
  35.          printf(   "   F =  %f\n\n",f);
  36.  
  37.         for(i = 0; i <= 12; i++)
  38.         {
  39.           fprintf(*fp,"av[%d] = %15.7f\n",i,av[i]);
  40.            printf(   "av[%d] = %15.7f\n",i,av[i]);
  41.         }
  42.      }
  43.  
  44.