Tests added to the repository.
[picobit.git] / tests / test-math.scm
blob547144ec2a7ebcf7bbdb0dc18978c67f85790003
1 ;; test to see if binary arithmetic operator optimisation breaks anything
2 ;; now a test to see if the new bignums break arithmetic
3 (define (foo x y z)
4   (* 2 3 (+ x 3) (- y 2) (+ z 1))) ;; TODO OK everything works for that now
6 ;; (define (foo x y z)
7 ;;   (+ 80 (* 2 3 (+ 2 x) (- z 5)))) ; TODO 200 didn't seem to be encoded as an int, or maybe the final 254...
8 ;; TODO +50 or +70 is ok, but not +100 or +80 which give decode_int8 errors
10 (display (if (= (foo 1 3 8) 216)
11  ; (if (= (foo 1 3 8) 216)
12  ; (if (= (foo 1 3 8) 134)
13              "OK\n"
14              "NAH\n"))
16 ;; TODO weird, with the original test (216), the wrong result was given, but no decode_int8 was given