* 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.
This commit is contained in:
parent
bb9937df2d
commit
c8722a9799
4 changed files with 26 additions and 7 deletions
|
|
@ -1,3 +1,8 @@
|
|||
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>
|
||||
|
||||
* 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
|
|||
which is not a Lisp list.
|
||||
|
||||
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
|
||||
@samp{(bigneg @var{d0} @var{d1} @var{d2} @dots{})} for negative integers
|
||||
@mathit{-1000000} or less. Each @var{d} is a base-1000 ``digit,'' a Lisp integer
|
||||
from 0 to 999. The least significant digit is @var{d0}; the last digit,
|
||||
@var{d1} @var{d2} @dots{})} for sufficiently large positive integers
|
||||
(where ``sufficiently large'' depends on the machine), or
|
||||
@samp{(bigneg @var{d0} @var{d1} @var{d2} @dots{})} for negative
|
||||
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
|
||||
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 user. In @code{defmath} definitions, the Lisp predicate @code{integerp}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
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>
|
||||
|
||||
* tmm.el (tmm--history): New dynamic variable.
|
||||
|
|
|
|||
|
|
@ -815,8 +815,14 @@
|
|||
(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 (%
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue