fixed uint/ulong pointer ref bug (and added appropriate tests).

This commit is contained in:
Abdulaziz Ghuloum
2008-09-14 00:38:59 -07:00
parent 58d937c520
commit 9f2d7484ab
7 changed files with 55 additions and 150 deletions
+1 -1
View File
@@ -1 +1 @@
1597
1598
+30 -30
View File
@@ -55,35 +55,35 @@
(f 0 536870911000 536870911)
(printf "[exact-integer-sqrt] Happy Happy Joy Joy\n"))
;(test-bitwise-op)
;(test-parse-flonums)
;(test-case-folding)
;(test-reader)
;(test-char-syntax)
;(test-bytevectors)
;(test-strings)
;(test-exact-integer-sqrt)
;(test-bignum-to-flonum)
;(test-bignum->flonum)
;(test-string-to-number)
;(test-div-and-mod)
;(test-bignums)
;(test-bignum-length)
;(test-fxcarry)
;(test-lists)
;(test-hashtables)
;(test-input-ports)
;(test-bignum-conversion)
;(test-fldiv-and-mod)
;(test-fldiv0-and-mod0)
;(test-fxdiv-and-mod)
;(test-fxdiv0-and-mod0)
;(test-fxlength)
;(test-bitwise-bit-count)
;(test-io)
;(test-sorting)
;(test-fasl)
;(test-numerics)
;(test-enums)
(test-bitwise-op)
(test-parse-flonums)
(test-case-folding)
(test-reader)
(test-char-syntax)
(test-bytevectors)
(test-strings)
(test-exact-integer-sqrt)
(test-bignum-to-flonum)
(test-bignum->flonum)
(test-string-to-number)
(test-div-and-mod)
(test-bignums)
(test-bignum-length)
(test-fxcarry)
(test-lists)
(test-hashtables)
(test-input-ports)
(test-bignum-conversion)
(test-fldiv-and-mod)
(test-fldiv0-and-mod0)
(test-fxdiv-and-mod)
(test-fxdiv0-and-mod0)
(test-fxlength)
(test-bitwise-bit-count)
(test-io)
(test-sorting)
(test-fasl)
(test-numerics)
(test-enums)
(test-pointers)
(printf "Happy Happy Joy Joy\n")
+10 -7
View File
@@ -43,20 +43,23 @@
(if (< n 0)
'()
(cons (sll 1 n) (one-bit-combinations n)))))
(define (two-bit-combinations n)
(define (or* ls1 ls2)
(apply append
(map
(lambda (n1)
(map
(lambda (n2)
(bitwise-ior n1 n2))
(one-bit-combinations n)))
(one-bit-combinations n))))
ls2))
ls1)))
(let ([n (min bits n)])
(append
(list 0)
(one-bit-combinations n)
(two-bit-combinations n))))
(let* ([ls1 (one-bit-combinations n)]
[ls2 (or* ls1 ls1)]
[ls3 (or* ls2 ls1)])
(append
(list 0 (sub1 (sll 1 (- n 1))) (sub1 (sll 1 n)))
ls1 ls2 ls3))))