For the polynomial divition im trying to use the input as a list that specifies the number with the variable (for example x^3+2x^2-8x+1 would be the list (1 2 -8 1) ) and another imput with the next polynom that will be dividing this one (for example x-5 as (0 0 1 -5) ).
┐Would it be better to treat them booth as vectors and try to operate them in that way? i was trying to do that, but to be honest im having a hard time with the start of the problem. The code i have for the functions i`ve already coded is this :
(define cuadrado ; ^2 function (lambda (x) (* x x))) (define porciento ; % function (lambda (x y) (*(/ y x) 100))) ( define (potencia base exponente) ; x^y function (if ( zero? exponente ) 1 ( * base ( potencia base (- exponente 1))))) (define factorial ; ! function (lambda (n) (if (= n 0) 1 (* n (factorial (- n 1)))))) (define (suma lista) ; + (if (null? lista) 0 (+ (car lista) (suma (cdr lista))))) (define (resta lista) ; - (if (null? lista) 0 (- (car lista) (suma (cdr lista))))) (define (multiplicacion lista) ; * (if (null? lista) 1 (* (car lista) (multiplicacion (cdr lista))))) (define (division lista) ; / (if (null? lista) 1 (/ (car lista) (multiplicacion (cdr lista)))))
Here is pretty hard to buy books since they are very expensive in conparison to Usa or Europe prices. Any kind of online course that would help me to understand Scheme in a better way would be apreciatted. At this moment im using the MIT book and currently reading http://www.shido.inf.../idx_scm_e.html (since i just found out about it on this page).
Once again, Im sorry for the rusty english im doing my best to learn about it
Thanks to everyone that decide to take some time and read this post,