[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: phone calls from hell




Hey - he spent so much time training suicide bombers maybe the phone was 
set to blow if anyone dialed the, er,  Samaritans.

Simon

(defun modexpt (x y n)  "computes (x^y) mod n"
  (cond ((= y 0) 1) 	((= y 1) (mod x n))
	((evenp y) (mod (expt (modexpt x (/ y 2) n) 2) n))
	(t (mod (* x (modexpt x (1- y) n)) n))))