From db9de51d07b5a9580e292ab02a49aeba33f3e0cf Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Tue, 10 Dec 2013 07:13:17 -0800 Subject: [PATCH] [bugfix] min and max are broken --- piclib/built-in.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/piclib/built-in.scm b/piclib/built-in.scm index bc53c2eb..ba92f7b7 100644 --- a/piclib/built-in.scm +++ b/piclib/built-in.scm @@ -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)