A bug in trig functions



The mmod function in trigi.lisp is to blame for the problem with sin(n %pi
/ 2) with
n declared an integer.  Changing MMOD to

(defun MMOD (x y)
  (cond ((and ($ratnump x) ($ratnump y))
      (let
          ((d (lcm ($denom x) ($denom y))))
        (setq x (mul* d x))
        (setq y (mul* d y))
        (div (mod x y) d)))
     (t nil)))

seems to fix this problem. After make, Maxima was then able to correctly evaluate
sin(n %pi), sin(n %pi / 2),  cos(n %pi), and cos(n %pi / 2), where n is declared to
be an integer.


Regards,

Barton