home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / gnuc / gnulib / rcs / modsi3.c,v < prev    next >
Encoding:
Text File  |  1992-07-04  |  406 b   |  42 lines

  1. head    1.1;
  2. access;
  3. symbols
  4.     version39-41:1.1;
  5. locks;
  6. comment    @ * @;
  7.  
  8.  
  9. 1.1
  10. date    92.06.08.19.47.59;    author mwild;    state Exp;
  11. branches;
  12. next    ;
  13.  
  14.  
  15. desc
  16. @initial checkin
  17. @
  18.  
  19.  
  20. 1.1
  21. log
  22. @Initial revision
  23. @
  24. text
  25. @#include "common.h"
  26.  
  27. SItype
  28. __modsi3 (a, b)
  29.      SItype a, b;
  30. {
  31.   unsigned SItype q, r;
  32.   int neg = (a < 0);
  33.  
  34.   if (a < 0) a = -a;
  35.   if (b < 0) b = -b;
  36.  
  37.   divmodu (q, r, a, b);
  38.  
  39.   return neg ? -r : r;
  40. }
  41. @
  42.