|
codepad
|
|
|
Project:
programmingpraxis
|
|
|
|
|
Recent Pastes:
; data encryption standard
(define (vector-map proc . vecs)
(define (elt i)
(lambda (vec)
|
| view (394 lines) |
; data encryption standard
(define (vector-map proc . vecs)
(define (elt i)
(lambda (vec)
|
| view (394 lines) |
; data encryption standard
(define (vector-map proc . vecs)
(define (elt i)
(lambda (vec)
|
| view (386 lines) |
; data encryption standard
(define (vector-map proc . vecs)
(define (elt i)
(lambda (vec)
|
| view (246 lines, 2 lines of output) |
; data encryption standard
(define (vector-map proc . vecs)
(define (elt i)
(lambda (vec)
|
| view (249 lines, 2 lines of output) |
; chinese remainder theorem
(define (euclid x y)
(let loop ((a 1) (b 0) (g x) (u 0) (v 1) (w y))
(if (zero? w) (values a b g)
|
| view (23 lines, 1 line of output) |
; lexicographic permutations
(define (next-perm lt? zs)
(if (null? zs) zs
(let next ((xlist (list (car zs))) (ys (cdr zs)))
|
| view (29 lines, 5 lines of output) |
; chinese remainder theorem
(define (euclid x y)
(let loop ((a 1) (b 0) (g x) (u 0) (v 1) (w y))
(if (zero? w) (values a b g)
|
| view (33 lines, 7 lines of output) |
; chinese remainder theorem
(define (euclid x y)
(let loop ((a 1) (b 0) (g x) (u 0) (v 1) (w y))
(if (zero? w) (values a b g)
|
| view (33 lines, 7 lines of output) |
; chinese remainder theorem
(define (euclid x y)
(let loop ((a 1) (b 0) (g x) (u 0) (v 1) (w y))
(if (zero? w) (values a b g)
|
| view (32 lines, 2 lines of output) |
; shanks' square form factorization algorithm
(define (isqrt n)
(if (not (and (positive? n) (integer? n)))
(error 'isqrt "must be positive integer")
|
| view (72 lines, 1 line of output) |
(define (isqrt n)
(if (not (and (positive? n) (integer? n)))
(error 'isqrt "must be positive integer")
(let loop ((x n))
(let ((y (quotient (+ x (quotient n x)) 2)))
|
| view (70 lines, 1 line of output) |
(define (isqrt n)
(if (not (and (positive? n) (integer? n)))
(error 'isqrt "must be positive integer")
(let loop ((x n))
(let ((y (quotient (+ x (quotient n x)) 2)))
|
| view (70 lines, 1 line of output) |
; shanks's squfof
(define (isqrt n)
(if (not (and (positive? n) (integer? n)))
(error 'isqrt "must be positive integer")
|
| view (153 lines, 1 line of output) |
; shanks's squfof
(define (isqrt n)
(if (not (and (positive? n) (integer? n)))
(error 'isqrt "must be positive integer")
|
| view (153 lines, 1 line of output) |