;;; calc-comb.el --- combinatoric functions for Calc
;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: David Gillespie <daveg@synaptics.com>
;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;;; Factorial and related functions.
(defconst math-small-factorial-table
- (eval-when-compile
- (vector 1 1 2 6 24 120 720 5040 40320 362880
- (math-read-number-simple "3628800")
- (math-read-number-simple "39916800")
- (math-read-number-simple "479001600")
- (math-read-number-simple "6227020800")
- (math-read-number-simple "87178291200")
- (math-read-number-simple "1307674368000")
- (math-read-number-simple "20922789888000")
- (math-read-number-simple "355687428096000")
- (math-read-number-simple "6402373705728000")
- (math-read-number-simple "121645100408832000")
- (math-read-number-simple "2432902008176640000"))))
+ (vector 1 1 2 6 24 120 720 5040 40320 362880 3628800 39916800
+ (math-read-number-simple "479001600")
+ (math-read-number-simple "6227020800")
+ (math-read-number-simple "87178291200")
+ (math-read-number-simple "1307674368000")
+ (math-read-number-simple "20922789888000")
+ (math-read-number-simple "355687428096000")
+ (math-read-number-simple "6402373705728000")
+ (math-read-number-simple "121645100408832000")
+ (math-read-number-simple "2432902008176640000")))
(defun calcFunc-fact (n) ; [I I] [F F] [Public]
(let (temp)
nil
(if (Math-integerp var-RandSeed)
(let* ((seed (math-sub 161803 var-RandSeed))
- (mj (1+ (math-mod seed
- (eval-when-compile
- (math-read-number-simple "1000000")))))
- (mk (1+ (math-mod (math-quotient
- seed
- (eval-when-compile
- (math-read-number-simple "1000000")))
- (eval-when-compile
- (math-read-number-simple "1000000")))))
+ (mj (1+ (math-mod seed 1000000)))
+ (mk (1+ (math-mod (math-quotient seed 1000000)
+ 1000000)))
(i 0))
(setq math-random-table (cons 'vec (make-list 55 mj)))
(while (<= (setq i (1+ i)) 54)
(error "Argument must be an integer"))
((Math-integer-negp n)
'(nil))
- ((Math-natnum-lessp n
- (eval-when-compile
- (math-read-number-simple "8000000")))
+ ((Math-natnum-lessp n 8000000)
(setq n (math-fixnum n))
(let ((i -1) v)
(while (and (> (% n (setq v (aref math-primes-table
(+
sum
(calcFunc-mod
- q
- (eval-when-compile
- (math-read-number-simple
- "1000000"))))
+ q 1000000))
111111))
(setq q
(math-quotient
- q
- (eval-when-compile
- (math-read-number-simple
- "1000000")))))
+ q 1000000)))
(cond ((= (% sum 3) 0) '(nil 3))
((= (% sum 7) 0) '(nil 7))
((= (% sum 11) 0) '(nil 11))
(provide 'calc-comb)
-;;; arch-tag: 1d75ee9b-0815-42bd-a321-bb3dc001cc02
+;; arch-tag: 1d75ee9b-0815-42bd-a321-bb3dc001cc02
;;; calc-comb.el ends here