Commit c8722a97 authored by Jay Belanger's avatar Jay Belanger
Browse files

* calc/calc-comb.el (math-prime-test): Don't assume large integers are

  represented by lists.

* doc/misc/calc.el (Data Type Formats): Don't specify the size at
  which integers begin to be represented by lists.
parent bb9937df
2013-10-17 Jay Belanger <jay.p.belanger@gmail.com>
* calc.el (Data Type Formats): Don't specify the size at
which integers begin to be represented by lists.
2013-10-14 Xue Fuqiao <xfq.free@gmail.com> 2013-10-14 Xue Fuqiao <xfq.free@gmail.com>
* cl.texi (Argument Lists): Add indexes for &key and &aux. * cl.texi (Argument Lists): Add indexes for &key and &aux.
......
...@@ -33306,12 +33306,15 @@ Lisp integers. This is the only storage format for Calc data objects ...@@ -33306,12 +33306,15 @@ Lisp integers. This is the only storage format for Calc data objects
which is not a Lisp list. which is not a Lisp list.
   
Large integers are stored as lists of the form @samp{(bigpos @var{d0} Large integers are stored as lists of the form @samp{(bigpos @var{d0}
@var{d1} @var{d2} @dots{})} for positive integers 1000000 or more, or @var{d1} @var{d2} @dots{})} for sufficiently large positive integers
@samp{(bigneg @var{d0} @var{d1} @var{d2} @dots{})} for negative integers (where ``sufficiently large'' depends on the machine), or
@mathit{-1000000} or less. Each @var{d} is a base-1000 ``digit,'' a Lisp integer @samp{(bigneg @var{d0} @var{d1} @var{d2} @dots{})} for negative
from 0 to 999. The least significant digit is @var{d0}; the last digit, integers. Each @var{d} is a base-@expr{10^n} ``digit'' (where again,
@expr{n} depends on the machine), a Lisp integer from 0 to
99@dots{}9. The least significant digit is @var{d0}; the last digit,
@var{dn}, which is always nonzero, is the most significant digit. For @var{dn}, which is always nonzero, is the most significant digit. For
example, the integer @mathit{-12345678} is stored as @samp{(bigneg 678 345 12)}. example, the integer @mathit{-12345678} might be stored as
@samp{(bigneg 678 345 12)}.
   
The distinction between small and large integers is entirely hidden from The distinction between small and large integers is entirely hidden from
the user. In @code{defmath} definitions, the Lisp predicate @code{integerp} the user. In @code{defmath} definitions, the Lisp predicate @code{integerp}
2013-10-17 Jay Belanger <jay.p.belanger@gmail.com>
* calc/calc-comb.el (math-prime-test): Don't assume large integers are
represented by lists.
2013-10-16 Glenn Morris <rgm@gnu.org> 2013-10-16 Glenn Morris <rgm@gnu.org>
* tmm.el (tmm--history): New dynamic variable. * tmm.el (tmm--history): New dynamic variable.
......
...@@ -815,8 +815,14 @@ ...@@ -815,8 +815,14 @@
(list nil v) (list nil v)
'(t)))) '(t))))
((not (equal n (car math-prime-test-cache))) ((not (equal n (car math-prime-test-cache)))
(cond ((= (% (nth 1 n) 2) 0) '(nil 2)) (cond ((if (consp n)
((= (% (nth 1 n) 5) 0) '(nil 5)) (= (% (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)) (t (let ((q n) (sum 0))
(while (not (eq q 0)) (while (not (eq q 0))
(setq sum (% (setq sum (%
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment