Quadratic equation solver

Calculate quadratic equation solver with clear inputs and assumptions.

Calculate quadratic equation solver with clear inputs and assumptions.

Both dots and commas are accepted as decimal separators.

Your inputs stay in your browser. Displayed results are rounded to a maximum of 12 significant digits.

Method and assumptions

Method version 1.0.0 · Updated

Calculate

Formula: Calculate quadratic equation solver with clear inputs and assumptions.

Calculate quadratic equation solver with clear inputs and assumptions.

a
Coefficient a (> 0)
b
Coefficient b
c
Coefficient c

Results are estimates where noted and depend on the entered assumptions.

Calculate with code

These short examples use the same inputs and core calculation as this tool. Adapt validation and formatting to your application.

JavaScript
const [a, b, c] = [1, -5, 6];
const d = b * b - 4 * a * c;
console.log([(-b - Math.sqrt(d)) / (2 * a), (-b + Math.sqrt(d)) / (2 * a)]); // [2, 3]
TypeScript
const [a, b, c] = [1, -5, 6];
const d: number = b * b - 4 * a * c;
console.log([(-b - Math.sqrt(d)) / (2 * a), (-b + Math.sqrt(d)) / (2 * a)]); // [2, 3]
Python
import math
a, b, c = 1, -5, 6
d = b*b - 4*a*c
print((-b-math.sqrt(d))/(2*a), (-b+math.sqrt(d))/(2*a))  # 2, 3
Java
double a = 1, b = -5, c = 6, d = b*b - 4*a*c;
System.out.println(( -b-Math.sqrt(d))/(2*a) + ", " + (-b+Math.sqrt(d))/(2*a)); // 2, 3
C#
double a = 1, b = -5, c = 6, d = b*b - 4*a*c;
Console.WriteLine($"{(-b-Math.Sqrt(d))/(2*a)}, {(-b+Math.Sqrt(d))/(2*a)}"); // 2, 3