home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / unixtex-6.1b-src.tgz / tar.out / contrib / unixtex / web2c / lib / fprintreal.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-28  |  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.