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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!