[bugfix] min and max are broken

This commit is contained in:
Yuichi Nishiwaki 2013-12-10 07:13:17 -08:00
parent 1651ef5d12
commit db9de51d07
1 changed files with 2 additions and 2 deletions

View File

@ -321,13 +321,13 @@
(let loop ((pivot x) (rest args))
(if (null? rest)
pivot
(loop (if (< x (car rest)) x (car rest)) (cdr rest)))))
(loop (if (< pivot (car rest)) pivot (car rest)) (cdr rest)))))
(define (max x . args)
(let loop ((pivot x) (rest args))
(if (null? rest)
pivot
(loop (if (> x (car rest)) x (car rest)) (cdr rest)))))
(loop (if (> pivot (car rest)) pivot (car rest)) (cdr rest)))))
(define (floor/ n m)
(values (floor-quotient n m)