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

  1.         /* General form test program for scientific functions */
  2.  
  3.         /* Routine Tested:  PLYMUL */
  4.  
  5.         main()
  6.  
  7.         {
  8.         int *fp,i,nda,ndb,ndc;
  9.         static float a[4]={2.,2.,2.,2.},
  10.                      b[3]={1.,-1.,2.};
  11.         float c[7];
  12.  
  13.         nda = 3;
  14.         ndb = 2;
  15.  
  16.         plymul(a,b,nda,ndb,c,&ndc);
  17.  
  18.         *fp=fopen("PRN:","w");                 /* open the printer */
  19.  
  20.         fprintf(*fp,"Test Results from PLYMUL\n\n");
  21.          printf("Test Results from PLYMUL\n\n");
  22.  
  23.         fprintf(*fp,"  NDC: %6.3d\n",ndc);
  24.          printf("  NDC: %6.3d\n",ndc);
  25.  
  26.         for(i = 0; i <= ndc; i++)
  27.         {
  28.         fprintf(*fp,"%9.5f\n",c[i]);
  29.          printf("%9.5f\n",c[i]);
  30.         }
  31.      }
  32.