Starting from:

$25

COEN-Programming Lab 8b Solved

Programming Lab #8b 

Solving Quadratics Using Hardware Floating-Point  

Topics: Floating-point instructions 

Prerequisite Reading: Chapters 1-9

Revised: August 27, 2019

 

float Quadratic(float x, float a, float b, float c) ; 

Computes the quadratic, 𝑎𝑥2+𝑏𝑥+𝑐

float Discriminant(float a, float b, float c) ; Computes the value of the discriminant, 𝑏2−4𝑎𝑐 Functions Root1 and Root2 should call this function.

These functions are called by a main program download from here. If your code is correct, the display should look similar to the image shown, the sliders can be used to vary the coefficient values, and pressing the blue pushbutton will restore the initial conditions. Otherwise, incorrect return values will cause an error message to be displayed as white text on a red background and the program will be halted.

 

More products