Skip to content

Instantly share code, notes, and snippets.

@t0yv0
Created February 5, 2011 16:44
Show Gist options
  • Select an option

  • Save t0yv0/812578 to your computer and use it in GitHub Desktop.

Select an option

Save t0yv0/812578 to your computer and use it in GitHub Desktop.
#lang racket
(define (quadratic a b c)
(let* ([det (- (* b b) (* 4 a c))]
[x1 (/ (- (sqrt det) b) (* 2 a))]
[x2 (/ (- (- (sqrt det)) b) (* 2 a))])
(vector x1 x2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment