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

  1.         /* General form test program for scientific functions */
  2.  
  3.         /* Routine Tested:  PLYIRT */
  4.  
  5.         main()
  6.  
  7.         {
  8.         int *fp,nd,ni;
  9.         static float a[5]={1.,-3.,-2.,5.,1.};
  10.         float e,root;
  11.  
  12.         nd = 4;
  13.         e = .00002;
  14.         ni = 1000;
  15.         root = 1.;
  16.      /* NOTE: There are actually 3 roots to this equation.
  17.               Testing with root= 0. and root=3. will
  18.                approximate the other two.                  */
  19.  
  20.  
  21.         plyirt(a,nd,ni,e,&root);
  22.  
  23.  
  24.         *fp=fopen("PRN:","w");                /* open the printer */
  25.  
  26.         fprintf(*fp,"Test Results from PLYIRT\n\n");
  27.          printf("Test Results from PLYIRT\n\n");
  28.  
  29.         fprintf(*fp," NUMRT = %f\n\n",root);
  30.          printf(" NUMRT = %f\n\n",root);
  31.  
  32.         }
  33.  
  34.