Doug Orleans’ cute program to compute roots of quadratic equations:
(define (± x y) (shift k (values (k (+ x y)) (k (- x y))))) (define (quadratic-formula-roots a b c) (reset (/ (± (- b) (√ (- (² b) (* 4 a c)))) (* 2 a))))
Doug Orleans’ cute program to compute roots of quadratic equations:
(define (± x y) (shift k (values (k (+ x y)) (k (- x y))))) (define (quadratic-formula-roots a b c) (reset (/ (± (- b) (√ (- (² b) (* 4 a c)))) (* 2 a))))
Post a Comment