2 (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 See the copyright notice in the ACK home directory, in the file "Copyright".
7 Module: implementation of DIV and MOD
8 Author: Ceriel J.H. Jacobs
10 Reason: We cannot use DVI and RMI, because DVI rounds towards 0
11 and Modula-2 requires truncation
20 if (j
== 0) TRP(EIDIVZ
);
21 if ((i
< 0) != (j
< 0)) {
33 if (j
== 0) TRP(EIDIVZ
);
34 if ((i
< 0) != (j
< 0)) {
46 if (j
== 0) TRP(EIDIVZ
);
48 if ((i
< 0) != (j
< 0)) {
51 return j
*((i
+j
-1)/j
)-i
;
60 if (j
== 0) TRP(EIDIVZ
);
61 if (i
== 0) return 0L;
62 if ((i
< 0) != (j
< 0)) {
65 return j
*((i
+j
-1)/j
)-i
;