Question: OCAML PROGRAMMING LANGUAGE. Write a function called quadratic that takes three arguments representing the three coecients a, b, and c of a quadratic equation and
OCAML PROGRAMMING LANGUAGE.
Write a function called quadratic that takes three arguments representing the three coecients a, b, and c of a quadratic equation and uses the quadratic formula to calculate the two roots of the equation. If the discriminant b24ac is negative, raise an exception called No_Real_Roots. Otherwise return a tuple containing the two roots, even if the roots are identical.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
