![]() When D < 0, the quadratic equation has two complex roots.Ĭomplex roots consist of a real and an imaginary part. The Python code is as follows: x = -b / (2*a) In this case, the roots will be identical. When D = 0, the quadratic equation has one real root. The Python code for this case is as follows: x1 = (-b + math.sqrt(D)) / (2*a) We can use the quadratic formula to calculate these roots.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |