Quadratic Positive Root

Compute the larger real root of a quadratic equation ax² + bx + c = 0 using the quadratic formula.

Ensure coefficients are correct; complex roots are not handled.

Examples

  • a=1, b=-3, c=2 ⇒ 2
  • a=2, b=-7, c=3 ⇒ 3
  • a=1, b=-5, c=6 ⇒ 3

FAQ

What if the discriminant is negative?

The result becomes NaN because there are no real roots.

Why use the plus sign?

It provides the larger of the two roots.

Can a be zero?

No, then the equation is not quadratic.

Additional Information

  • Result unit: number