home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / GCC / GERLIB_DEV08B.LHA / gerlib / gnulib / normal / divsi3.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-12  |  214 b   |  17 lines

  1. #include "common.h"
  2.  
  3. SItype
  4. __divsi3 (a, b)
  5.      SItype a, b;
  6. {
  7.   unsigned SItype q, r;
  8.   int neg = (a < 0) != (b < 0);
  9.  
  10.   if (a < 0) a = -a;
  11.   if (b < 0) b = -b;
  12.  
  13.   divmodu (q, r, a, b);
  14.  
  15.   return neg ? -q : q;
  16. }
  17.