[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r114692: * calc/calc-comb.el (math-prime-test): Don'
From: |
Jay Belanger |
Subject: |
[Emacs-diffs] trunk r114692: * calc/calc-comb.el (math-prime-test): Don't assume large integers are |
Date: |
Thu, 17 Oct 2013 03:37:20 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 114692
revision-id: address@hidden
parent: address@hidden
committer: Jay Belanger <address@hidden>
branch nick: trunk
timestamp: Wed 2013-10-16 22:37:05 -0500
message:
* 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.
modified:
doc/misc/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-6331
doc/misc/calc.texi calc.texi-20091113204419-o5vbwnq5f7feedwu-6290
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/calc/calc-comb.el
calccomb.el-20091113204419-o5vbwnq5f7feedwu-2273
=== modified file 'doc/misc/ChangeLog'
--- a/doc/misc/ChangeLog 2013-10-14 22:25:14 +0000
+++ b/doc/misc/ChangeLog 2013-10-17 03:37:05 +0000
@@ -1,3 +1,8 @@
+2013-10-17 Jay Belanger <address@hidden>
+
+ * calc.el (Data Type Formats): Don't specify the size at
+ which integers begin to be represented by lists.
+
2013-10-14 Xue Fuqiao <address@hidden>
* cl.texi (Argument Lists): Add indexes for &key and &aux.
=== modified file 'doc/misc/calc.texi'
--- a/doc/misc/calc.texi 2013-03-31 20:27:40 +0000
+++ b/doc/misc/calc.texi 2013-10-17 03:37:05 +0000
@@ -33306,12 +33306,15 @@
which is not a Lisp list.
Large integers are stored as lists of the form @samp{(bigpos @var{d0}
address@hidden @var{d2} @dots{})} for positive integers 1000000 or more, or
address@hidden(bigneg @var{d0} @var{d1} @var{d2} @dots{})} for negative integers
address@hidden 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,
address@hidden @var{d2} @dots{})} for sufficiently large positive integers
+(where ``sufficiently large'' depends on the machine), or
address@hidden(bigneg @var{d0} @var{d1} @var{d2} @dots{})} for negative
+integers. Each @var{d} is a address@hidden ``digit'' (where again,
address@hidden depends on the machine), a Lisp integer from 0 to
address@hidden 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
address@hidden(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}
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-10-16 18:23:15 +0000
+++ b/lisp/ChangeLog 2013-10-17 03:37:05 +0000
@@ -1,3 +1,8 @@
+2013-10-17 Jay Belanger <address@hidden>
+
+ * calc/calc-comb.el (math-prime-test): Don't assume large integers are
+ represented by lists.
+
2013-10-16 Glenn Morris <address@hidden>
* tmm.el (tmm--history): New dynamic variable.
=== modified file 'lisp/calc/calc-comb.el'
--- a/lisp/calc/calc-comb.el 2013-01-01 09:11:05 +0000
+++ b/lisp/calc/calc-comb.el 2013-10-17 03:37:05 +0000
@@ -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 (%
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r114692: * calc/calc-comb.el (math-prime-test): Don't assume large integers are,
Jay Belanger <=