Test output for quaternions [fail]
Testing time: 0s
/home/mario/local/chicken-4.8.0.3/bin/csi -script run.scm < /dev/null Error: (quotient) bad argument type - not an integer: 3.14159265 Call history: <eval> [=5] (to-5-dp n1) <eval> [to-5-dp] (/ (round (* f 100000)) 100000) <eval> [to-5-dp] (round (* f 100000)) <eval> [to-5-dp] (* f 100000) <eval> [=5] (to-5-dp n2) <eval> [to-5-dp] (/ (round (* f 100000)) 100000) <eval> [to-5-dp] (round (* f 100000)) <eval> [to-5-dp] (* f 100000) <eval> (>=337 check:mode338 1) <eval> (check:proc339 (quote340 (angle q)) (lambda341 () (angle q)) =mod-pi 2.0) <eval> (angle q) <eval> [=mod-pi] (= (to-5-dp (modulo (make-positive a1) PI)) (to-5-dp (modulo (make-positive a2) PI))) <eval> [=mod-pi] (to-5-dp (modulo (make-positive a1) PI)) <eval> [=mod-pi] (modulo (make-positive a1) PI) <eval> [=mod-pi] (make-positive a1) <eval> [make-positive] (>= n 0) <-- (number? q1) => #t ; correct (number? q2) => #t ; correct (number? q3) => #t ; correct (quaternion? q1) => #t ; correct (quaternion? q2) => #t ; correct (quaternion? q3) => #t ; correct (real-part q1) => 0 ; correct (real-part q2) => 0 ; correct (imag-part q2) => 1 ; correct (real-part q3) => 0 ; correct (imag-part q3) => 1 ; correct (jmag-part q3) => 2 ; correct (kmag-part q3) => 3 ; correct (magnitude 4) => 4 ; *** failed *** ; expected result: 4.0 (magnitude (make-rectangular 1 2)) => 2.23606797749979 ; correct (magnitude q3) => 3.74165738677394 ; correct (angle 2+2i) => 0.785398163397448 ; correct (angle q3) => 1.5707963267949 ; correct (= 3 3) => #t ; correct (= q1 0) => #t ; correct (= q2 0+1i) => #t ; correct (= q3 (make-rectangular 0 1 2 3)) => #t ; correct (= q1 q2) => #f ; correct (= q2 q3) => #f ; correct (= q3 (make-rectangular 0 1 2 4)) => #f ; correct (= q3 (make-rectangular 0 1 4 3)) => #f ; correct (+ q3 q3) => 0+2i+4j+6k ; correct (+ 1+2i q3) => 1+3i+2j+3k ; correct (- q3 1+2i) => -1-1i+2j+3k ; correct (* 2 q3) => 0+2i+4j+6k ; correct (/ (make-rectangular 2 4 6 8) 2) => 1+2i+3j+4k ; correct (magnitude q) => 1.0 ; correct (angle q) => 2.0 ;