mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 14:49:18 +02:00
odd? should check absolute value of remainder
This commit is contained in:
parent
c0fc89ece4
commit
e53230c439
1 changed files with 1 additions and 1 deletions
|
@ -1040,7 +1040,7 @@
|
|||
(define (positive? x) (> x 0))
|
||||
(define (negative? x) (< x 0))
|
||||
(define (even? n) (= (remainder n 2) 0))
|
||||
(define (odd? n) (= (remainder n 2) 1))
|
||||
(define (odd? n) (= (abs (remainder n 2)) 1))
|
||||
|
||||
(define (abs x) (if (< x 0) (- x) x))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue