Fix collatz typed benchmark for fix to odd? and even?.

This commit is contained in:
Vincent St-Amour 2013-01-18 18:19:14 -05:00
parent 091e26cde8
commit 193bff7a2b

View File

@ -10,7 +10,9 @@
[(odd? n)
(+ 1 (cycle-length (+ 1 (* 3 n))))]
[(even? n)
(+ 1 (cycle-length (/ n 2)))]
;; TR note: quotient would work better, but that's the other version of
;; the benchmark
(+ 1 (cycle-length (assert (/ n 2) integer?)))]
[else (error "unreachable")]))
(time (let: loop : (U False Integer)