exercise-34.scm (594B)
1 (define-library (sicp tests chapter-2 exercise-34) 2 (import (scheme base) 3 (srfi :64)) 4 (import (sicp solutions chapter-2 exercise-34)) 5 6 (begin 7 (test-begin "chapter-2-exercise-34") 8 (test-equal 9 (let ([x 2]) 10 (+ (* 1) ; a_0 11 (* 3 x) ; a_1 12 (* 0 x x) ; a_2 13 (* 5 x x x) ; a_3 14 (* 0 x x x x) ; a_4 15 (* 1 x x x x x) ; a_5 16 )) 17 (horner-eval 2 '(1 3 0 5 0 1))) 18 (test-end "chapter-2-exercise-34")))