The web page 208307.htm presents and describes a program, QUAD1, that performs the "quadratic formula" for solving certain quadratic equations of the form

Ax2 + Bx + C = 0
where we are assuming that A, B, and C are integers, and that A is not 0. The output of the program is correct, but it only gives answers that are REAL numbers, either Rational or Irrational. In particular, the QUAD1 proigram does not identify Complex Number answers. This page presents a listing of a new version of that program, called QUAD2, a version that produces nice looking output, even for Complex Number answers. The listings below are for the TI-83 version of the QUAD2 program, given in two parts.

A comparison of part 1 of the QUAD2 program with the QUAD1 program given on the earlier quad1.htm page, should confirm that the main part of the program is unchanged from one version to the other. The extra lines in QUAD2 are used to handle the case of the Complex Number answers. This is done by identifying, through examining the Discriminant, cases where the answer will be Complex, and retaining that information in the variable T. T will be used later in the program to format the output to include the imaginary number i for complex answers. Also, notice that the QUAD2 program calls (makes reference to) the TOSTR program in order to acheive a nicer looking output. TOSTR must be available on the calculator. The listing for the TOSTR program, was given on the 208304.htm page.

Naturally, one could enter the programs into a calculator. However, the TI-83 file for QUAD2 in is available at quad2.83p and the TI-83 file for TOSTR at tostr.83p. Depending upon your browser, you should be able to save the file to your disk and then transfer it via TI-Graphlink, assuming you have the program and the required cable.

We conclude this page with few sample runs of the TI-83 version of the QUAD2 program. We will be solving the following quadratic equations:

x2 + 25 = 0
x2 + 27 = 0
7x2 + 31 = 0
x2 - 8x + 25 = 0
x2 - 4x + 67 = 0
49x2 - 42x + 29 = 0