debug, tested

This commit is contained in:
Shiven Tripathi
2020-10-17 18:22:20 +05:30
committed by GitHub
parent bac5354808
commit 2b5a8135dc

View File

@@ -535,10 +535,13 @@ def commonFactorsFunc(maxVal=100):
def quadraticEquation(maxVal=100):
a = random.randint(1,maxVal)
c = random.randint(1,maxVal)
b = random.randint(4*a*c,4*maxVal*maxVal)
b = random.randint(round(math.sqrt(4*a*c))+1,round(math.sqrt(4*maxVal*maxVal)))
problem = "Zeros of the Quadratic Equation {a}x^2+{b}x+{c}=0".format(a,b,c)
solution = str[(-b+sqrt(b^2-4*a*c))/2*a,(-b-sqrt(b^2-4*a*c))/2*a]
problem = "Zeros of the Quadratic Equation {}x^2+{}x+{}=0".format(a,b,c)
D = math.sqrt(b*b-4*a*c)
solution = str([(-b+D)/(2*a),(-b-D)/(2*a)])
return problem,solution
# || Class Instances