home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume5 / tracer / g_bod.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-02-03  |  595 b   |  35 lines

  1. #include <stdio.h>
  2. #include <math.h>
  3. #include "extern.h"
  4. #include "macros.h"
  5.  
  6.  
  7. g_bod (f)
  8. FILE * f;
  9. {
  10.     int     k,
  11.             x;
  12.     double  big = 0.0,
  13.             little = HUGE;
  14.     char    buf[512];
  15.  
  16.  
  17.     for (ysue = 0;; ysue++) {
  18.     if (fgets (buf, 512, f) == NULL)
  19.         break;
  20.     xsue = strlen (buf) - 1;
  21.     for (x = 0; x < xsue; x++) {
  22.         k = buf[x];
  23.         suzie[x][ysue] = (double) k;
  24.         if (big < k)
  25.         big = k;
  26.         if (little > k)
  27.         little = k;
  28.     }
  29.     }
  30.     big = big - little;
  31.     for (k = 0; k < ysue; k++)
  32.     for (x = 0; x < xsue; x++)
  33.         suzie[x][k] = (suzie[x][k] - little) / big;
  34. }
  35.