home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / unixtex-6.1b-src.lha / unixtex-6.1b / web2c / lib / fprintreal.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-11  |  346 b   |  18 lines

  1. /* fprintreal.c: print the real number R in the Pascal format N:M on the
  2.    file F.  */
  3.  
  4. #include "config.h"
  5.  
  6. void
  7. fprintreal (f, r, n, m)
  8.   FILE *f;
  9.   double r;
  10.   int n, m;
  11. {
  12.   char fmt[50];  /* Surely enough, since N and M won't be more than 25
  13.                     digits each!  */
  14.  
  15.   sprintf (fmt, "%%%d.%dlf", n, m);
  16.   fprintf (f, fmt, r);
  17. }
  18.