30 lines
750 B
Turing
30 lines
750 B
Turing
(expect "+ - 3 parameters" (= (+ 2 4 2) 8))
|
|
(expect "- - 3 parameters" (= (- 8 2 3) 3))
|
|
(expect "* - 2 parameters" (= (* 5 6) 30))
|
|
(expect "/ - 2 parameters" (= (/ 64 4) 16))
|
|
|
|
(expect "evenp - 2" (evenp 2))
|
|
(expect "evenp - 3" (not (evenp 3)))
|
|
|
|
(expect "oddp - 5" (oddp 5))
|
|
(expect "oddp - 6" (not (oddp 6)))
|
|
|
|
(expect "zerop - 0" (zerop 0))
|
|
(expect "zerop - 1" (not (zerop 1)))
|
|
|
|
(expect "max - 2 parameters" (= (max 5 30) 30))
|
|
(expect "min - 2 parameters" (= (min 5 30) 5))
|
|
|
|
|
|
(comment (mod -1 5))
|
|
(expect "mod - (mod -1 5) == 4"
|
|
(= (mod -1 5) 4))
|
|
|
|
(expect "mod - (mod 13 4) == 1"
|
|
(= (mod 13 4) 1))
|
|
|
|
(expect "mod - (mod 13.5 1) == 0.5"
|
|
(= (mod 13.5 1) 0.5))
|
|
|
|
(expect "mod - (mod -13.5 1) == 0.5"
|
|
(= (mod -13.5 1) 0.5))
|