k.go 166 B

123456789
  1. package kata
  2. import "math"
  3. func Quadratic(a float64, b float64, c float64) float64 {
  4. // Citardauq formula.
  5. x2 := 2 * c / (-b - math.Sqrt(b*b-4*a*c))
  6. return x2
  7. }