, implement the procedure
and use this to define
as above. Now write a procedure
that computes the polynomial GCD of two polys. (The procedure should signal an error if the two polys are not in the same variable.) Install in the system a generic operation
that reduces to
for polynomials and to ordinary
for ordinary numbers. As a test, try
(define p1 (make-polynomial 'x '((4 1) (3 -1) (2 -2) (1 2)))) (define p2 (make-polynomial 'x '((3 1) (1 -1)))) (greatest-common-divisor p1 p2)
and check your result by hand.
There are no comments yet.
You must log in to post a comment.Login