]> code.delx.au - gnu-emacs/blobdiff - lisp/calc/calc-comb.el
Update copyright year to 2015
[gnu-emacs] / lisp / calc / calc-comb.el
index 431ea18f5802474b4d8628080051b81015700469..4e52a3b144eabda8bc1eec9fa544d5675e4ea67a 100644 (file)
@@ -1,6 +1,6 @@
 ;;; calc-comb.el --- combinatoric functions for Calc
 
-;; Copyright (C) 1990-1993, 2001-2012 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2015 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
                         (list nil v)
                       '(t))))
                  ((not (equal n (car math-prime-test-cache)))
-                  (cond ((= (% (nth 1 n) 2) 0) '(nil 2))
-                        ((= (% (nth 1 n) 5) 0) '(nil 5))
+                  (cond ((if (consp n)
+                              (= (% (nth 1 n) 2) 0)
+                            (= (% n 2) 0))
+                          '(nil 2))
+                        ((if (consp n)
+                              (= (% (nth 1 n) 5) 0)
+                            (= (% n 5) 0))
+                          '(nil 5))
                         (t (let ((q n) (sum 0))
                               (while (not (eq q 0))
                                 (setq sum (%