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

  1.         /* General form test program for scientific functions */
  2.  
  3.         /* Routine Tested:  NABAIR */
  4.  
  5.         main()
  6.  
  7.         {
  8.         int *fp,i,n,itag;
  9.         static float a[6]={5.,-85.,620.,-2540.,5175.,-4375.};
  10.         float b[5],c[5],eps,p1,q1,root[10];
  11.  
  12.         n = 5;
  13.         p1 = 0.;
  14.         q1 = 0.;
  15.         itag = 50;
  16.         eps = .0001;
  17.  
  18.         nabair(p1,q1,a,&itag,&n,eps,root,b,c);
  19.  
  20.         *fp=fopen("PRN:","w");                /* open the printer */
  21.  
  22.         fprintf(*fp,"Test Results from NABAIR\n\n");
  23.          printf("Test Results from NABAIR\n\n");
  24.  
  25.         fprintf(*fp," ITAG = %d   N = %d\n\n",itag,n);
  26.          printf(   " ITAG = %d   N = %d\n\n",itag,n);
  27.  
  28.         fprintf(*fp,"ROOTS   REAL                  IMAGINARY\n");
  29.          printf("ROOTS   REAL                  IMAGINARY\n");
  30.         for(i = 0; i<= 9; i+=2)
  31.         {
  32.         fprintf(*fp,"  %15.7f       %15.7f\n",root[i],root[i+1]);
  33.          printf("  %15.7f       %15.7f\n",root[i],root[i+1]);
  34.         }
  35.  
  36.         }
  37.  
  38.