]> code.delx.au - gnu-emacs/blobdiff - lisp/calc/calc-comb.el
Don’t create unnecessary marker in ‘delete-trailing-whitespace’
[gnu-emacs] / lisp / calc / calc-comb.el
index e09bef0b5c95c231f4fb612c5b37d2eb679bd88f..132757aed5c5ab1d97639aea09867a621ed97c28 100644 (file)
@@ -1,9 +1,8 @@
 ;;; calc-comb.el --- combinatoric functions for Calc
 
-;; Copyright (C) 1990-1993, 2001-2013 Free Software Foundation, Inc.
+;; Copyright (C) 1990-1993, 2001-2016 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
-;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
 
 ;; This file is part of GNU Emacs.
 
                         (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 (%