1: # include   <sccs.h>
   2: 
   3: SCCSID(@(#)IIitos.c	8.1	12/31/84)
   4: 
   5: 
   6: /*
   7: **  INTEGER OUTPUT CONVERSION
   8: **
   9: **	The integer `i' is converted to ascii and put
  10: **	into the static buffer `buf'.  The address of the starting
  11: **	point in `buf' is
  12: **	returned.
  13: **
  14: **	Number is converted from least significant forwards.
  15: */
  16: 
  17: char *IIitos(i1)
  18: int i1;
  19: {
  20:     register char   *a;
  21:     register int    i;
  22:     static char buf[25];
  23: 
  24:     i = i1;
  25:     if (i < 0)
  26:         i = -i;
  27: 
  28:     a = &buf[sizeof buf - 1];
  29:     *a-- = '\0';
  30:     do
  31:     {
  32:         *a-- = i % 10 + '0';
  33:         i /= 10;
  34:     } while (i);
  35:     if (i1 < 0)
  36:         *a-- = '-';
  37: 
  38:     a++;
  39:     return (a);
  40: }
Last modified: 1986-04-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 746
Valid CSS Valid XHTML 1.0 Strict