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

  1.         /* General form test program for scientific functions */
  2.  
  3.         /* Routine Tested:  STANVR */
  4.  
  5.         main()
  6.  
  7.     {
  8.         int *fp,i,lcx,nt,nb;
  9.         static float x[4][4]={4., 1.,-1., 0.,
  10.                               1., 1.,-1.,-2.,
  11.                               0., 0.,-3.,-2.,
  12.                               0.,-5.,-4.,-4.};
  13.         float av[13],ft,fb;
  14.  
  15.         lcx = 4;
  16.         nt = 4;
  17.         nb = 4;
  18.  
  19.        stanvr(lcx,nt,nb,x,&ft,&fb,av);
  20.  
  21.         *fp=fopen("PRN:","w");             /* open the printer */
  22.  
  23.         fprintf(*fp,"Test Results from STANVR\n");
  24.          printf("Test Results from STANVR\n\n");
  25.  
  26.         fprintf(*fp," FT = %15.10f  FB = %15.10f\n\n",ft,fb);
  27.          printf(   " FT = %15.10f  FB = %15.10f\n\n",ft,fb);
  28.  
  29.  
  30.         for(i = 0; i <= 12; i++)
  31.         {
  32.          fprintf(*fp," av[%d] = %15.8f \n",i,av[i]);
  33.           printf(   " av[%d] = %15.8f \n",i,av[i]);
  34.         }
  35.      }
  36.  
  37.