;;; calc-comb.el --- combinatoric functions for Calc
-;; Copyright (C) 1990-1993, 2001-2012 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 (%