Quadratic Formula Calculator
Classify a quadratic by its discriminant and solve its real roots using numerically stable arithmetic.
Smaller real root
a must be nonzero; a=0 is a linear equation and is not solved here. Real roots are displayed; complex roots are identified but not formatted. Very small coefficient ratios can exceed ordinary floating-point precision.
Formula checked · NumberSwift · Review process
How this calculator works
Enter coefficients for ax² + bx + c = 0. A positive discriminant gives two distinct real roots, zero gives a repeated real root and a negative discriminant indicates a complex-conjugate pair. This project’s existing formatter handles real values, so complex cases are classified rather than presented as partial or misleading real answers. The solver scales coefficients and calculates one root without subtracting nearly equal large terms, recovering the other from their product.
Formula
Discriminant D = b²−4ac. Quadratic formula x = (−b ± √D)/(2a). For two real roots, a stable equivalent uses q = −(b + sign(b)√D)/2, then roots q/a and c/q.
Assumptions & limitations
a must be nonzero; a=0 is a linear equation and is not solved here. Real roots are displayed; complex roots are identified but not formatted. Very small coefficient ratios can exceed ordinary floating-point precision.
Worked example
For a=1, b=−3, c=2, D=9−8=1 and roots are 1 and 2. For a=1, b=2, c=1, D=0 and the repeated root is −1. For a=1, b=0, c=1, D=−4 and there are no real roots.
Our approach to calculations ↗Common questions
What does a negative discriminant mean?
The equation has two complex conjugate roots and no real roots. This tool states the classification without pretending to display complex solutions.
Why is a=0 rejected?
A quadratic needs a nonzero squared-term coefficient. With a=0 the equation is linear or constant and requires different handling.
Why use a stable equivalent instead of the formula literally?
Subtracting almost equal quantities can erase a small root. An equivalent product-based calculation preserves more useful precision.