2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
12 ldiv(register long numer
, register long denom
)
16 /* The assignment of tmp should not be optimized !! */
21 r
.quot
= numer
/ denom
; /* might trap if denom == 0 */
22 r
.rem
= numer
% denom
;
23 } else if ( !tmp
&& ((numer
< 0) != (denom
< 0))) {
24 r
.quot
= (numer
/ denom
) + 1;
25 r
.rem
= numer
- (numer
/ denom
+ 1) * denom
;
27 r
.quot
= numer
/ denom
;
28 r
.rem
= numer
% denom
;