home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / tex / texsrc1 / Src / lib / c / fprintreal < prev    next >
Encoding:
Text File  |  1993-05-02  |  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.