From: edgar <edgarrft@we...>  20100624 21:31:50

Hi Paul, After realizing that REM in XLISP is limited to integers only, it was quite easy to write the missing MOD function: (defun mod (x y) (cond ((not (integerp x)) (error "MOD  bad argument type" x)) ((not (integerp y)) (error "MOD  bad argument type" y)) ((zerop y) (error "MOD  division by zero")) ((or (and (>= x 0) (< y 0)) ; x is positive, y is negative (and (< x 0) (> y 0))) ; x is negative, y is positive (+ x y)) ; unequal signs (t (rem x y)))) ; equal signs With equal signs: (rem 1 5) => 1 (mod 1 5) => 1 (rem 1 5) => 1 (mod 1 5) => 1 With unequal signs: (rem 1 5) => 1 (mod 1 5) => 4 (rem 1 5) => 1 (mod 1 5) => 4  edgar  The author of this email does not necessarily endorse the following advertisements, which are the sole responsibility of the advertiser: 