package main
import (
"fmt"
"math"
)
func main() {
// x= +- sqrtB-4ac/2a
cal()
}
func cal() {
b := 3
a := 4
c := 2
b2 := float64(b*b)
ac := float64(4)*float64(a)*float64(c)
q := math.Sqrt(b2-ac)
fmt.Print(q)
}
This will output a NaN, but why. I am trying to make a quadratic calculator. All I want is for this to output the number.