fixed uint/ulong pointer ref bug (and added appropriate tests).
This commit is contained in:
@@ -1 +1 @@
|
||||
1597
|
||||
1598
|
||||
|
||||
+30
-30
@@ -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")
|
||||
|
||||
@@ -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))))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user