; test_arith.lisp — arithmetic and comparisons. ; Run: cat test_arith.lisp | ./lisp ; ; Each form's expected result is in the trailing comment. (+ 1 2 3 4 5) ; => 15 (* 6 7) ; => 42 (- 100 25 25) ; => 50 (/ 100 5) ; => 20 (/ 1000 10 5) ; => 20 (mod 17 5) ; => 2 (- 7) ; => -7 (+ (* 2 3) (* 4 5)) ; => 26 (+ (- 50 10) (* 2 5)) ; => 50 (= 5 5) ; => #t (= 5 6) ; => #f (< 1 2 3 4) ; => #t (<= 3 3 4) ; => #t (> 5 3 1) ; => #t ; mixed int/float — int operands auto-promote (+ 1 2.5) ; => 3.5 (* 2 3.0) ; => 6.0 (/ 22.0 7.0) ; => 3.142857