DEFUN SIGN-OF is beyond repair
phoe opened this issue · comments
; returns sign x
(defun sign-of (x)
(if (< x 0) (return-from sign-of -1))
(if (eq x 0) (return-from sign-of 0))
1)
(sign-of 0.0)
;=>1
, not0
- it uses
eq
on a number, which has undefined result - it uses multiple
return-from
s instead of acond
or atypecase
cl:signum
exists
Will fix this in my fork and submit a PR along with all other koan fixes.