Create numbers.lisp with some basic numeric functions
[jscl.git] / tests / numbers.lisp
1 ;;;; Tests for numeric functions
2
3 ; ABS
4 (test (= (abs  3) 3))
5 (test (= (abs -3) 3))
6
7 ; MAX
8 (test (= (max 1)     1))
9 (test (= (max 1 2 3) 3))
10 (test (= (max 3 2 1) 3))
11
12 ; MIN
13 (test (= (min 1)     1))
14 (test (= (min 1 2 3) 1))
15 (test (= (min 3 2 1) 1))
16
17 ; EVENP
18 (test      (evenp  2))
19 (test      (evenp -2))
20 (test (not (evenp  1)))
21 (test      (evenp  0))
22
23 ; ODDP
24 (test      (oddp  3))
25 (test      (oddp -3))
26 (test (not (oddp  2)))
27 (test (not (oddp  0)))