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

  1.         /* General form test program for scientific functions */
  2.  
  3.         /* Routine Tested:  SMOTH */
  4.  
  5.         main()
  6.  
  7.     {
  8.         int *fp,i,l,m,n;
  9.         static float u[24]={2203.,2360.,2254.,2165.,2024.,2078.,
  10.                             2214.,2292.,2207.,2119.,2119.,2137.,
  11.                             2132.,1955.,1785.,1747.,1818.,1909.,
  12.                             1958.,1892.,1919.,1853.,1868.,1991.},
  13.                       w[5] ={.15,.15,.4,.15,.15};
  14.         float smooth[24];
  15.  
  16.         l = 1;
  17.         m = 5;
  18.         n = 24;
  19.  
  20.        smoth(u,n,w,m,l,smooth);
  21.  
  22.         *fp=fopen("PRN:","w");             /* open the printer */
  23.  
  24.         fprintf(*fp,"Test Results from SMOTH\n");
  25.          printf("Test Results from SMOTH\n\n");
  26.  
  27.         for(i = 0; i <= n-1; i++)
  28.         {
  29.       fprintf(*fp,"%15.10f \n",smooth[i]);
  30.        printf(   "%15.10f \n",smooth[i]);
  31.         }
  32.      }
  33.  
  34.