aboutsummaryrefslogtreecommitdiffstats
path: root/root.scm
diff options
context:
space:
mode:
authorThomas Bushnell, BSG <tb@debian.org>2007-12-28 16:25:32 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:39 -0800
commitd8ae23691ed6392b7f320f5fa7d4dd78ae52c10e (patch)
treeb20b8bc02e854c4c86d39ee22a0638a8b06e01af /root.scm
parentedd1ebef3ad774e7cbcc2f5918d555bfb0b44091 (diff)
parent64f037d91e0c9296dcaef9a0ff3eb33b19a2ed34 (diff)
downloadslib-d8ae23691ed6392b7f320f5fa7d4dd78ae52c10e.tar.gz
slib-d8ae23691ed6392b7f320f5fa7d4dd78ae52c10e.zip
Import Debian changes 3a5-1debian/3a5-1
slib (3a5-1) unstable; urgency=low * New upstream release. * slib.texi (Library Catalogs): Repeat change from 3a3-3. * Makefile: Repeat $(htmldir)slib_toc.html changes from 3a2-1. * guile.init: (library-vicinity): Repeat change from 3a4-2. * debian/rules (binary-indep): Don't hide .init files in a separate subdirectory, thus conforming better to the usual slib practice. Put a symlink in place to ease transitions. (Closes: #407370).
Diffstat (limited to 'root.scm')
-rw-r--r--root.scm28
1 files changed, 0 insertions, 28 deletions
diff --git a/root.scm b/root.scm
index 7045e54..667f05f 100644
--- a/root.scm
+++ b/root.scm
@@ -46,34 +46,6 @@
;; (lambda (x) (* 2 x))
;; (ash 1 (quotient (integer-length y) 2))))
-;;;; http://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/lisp/code/math/isqrt/isqrt.txt
-;;; Akira Kurihara
-;;; School of Mathematics
-;;; Japan Women's University
-;@
-(define integer-sqrt
- (let ((table '#(0
- 1 1 1
- 2 2 2 2 2
- 3 3 3 3 3 3 3
- 4 4 4 4 4 4 4 4 4))
- (square (lambda (x) (* x x))))
- (lambda (n)
- (define (isqrt n)
- (if (> n 24)
- (let* ((len/4 (quotient (- (integer-length n) 1) 4))
- (top (isqrt (ash n (* -2 len/4))))
- (init (ash top len/4))
- (q (quotient n init))
- (iter (quotient (+ init q) 2)))
- (cond ((odd? q) iter)
- ((< (remainder n init) (square (- iter init))) (- iter 1))
- (else iter)))
- (vector-ref table n)))
- (if (and (exact? n) (integer? n) (not (negative? n)))
- (isqrt n)
- (type-error 'integer-sqrt n)))))
-
;@
(define (newton:find-root f df/dx x_0 prec)
(if (and (negative? prec) (integer? prec))