A SERVICE OF

logo

15–28 Mathematics Programs
Program Lines:
(In RPN mode)
Description
 ! "
Displays complex roots if any.
 ! %
Stores second real root.
 #$ %
Displays second real root.
 !
Returns to calling routine.
Checksum and length: 96DA 30
"  "
Starts routine to display complex roots.
" ! L
Stores the imaginary part of the first complex root.
" #$ L
Displays the imaginary part of the first complex root.
" #$ %
Displays the real part of the second complex root.
"  L
Gets the imaginary part of the complex roots.
" -+.
Generates the imaginary part of the second complex
root.
" ! L
Stores the imaginary part of the second complex root.
" #$ L
Displays the imaginary part of the second complex
root.
Checksum and length: 748D 24
Flags Used:
Flag 0 is used to remember if the root is real or complex (that is, to remember the
sign of d). If d is negative, then flag 0 is set. Flag 0 is tested later in the program to
assure that both the real and imaginary parts are displayed if necessary.
Remarks:
The program accommodates polynomials of order 2, 3, 4, and 5. It does not
check if the order you enter is valid.
The program requires that the constant term
a
0
is nonzero for these polynomials. (If
a
0
is 0, then 0 is a real root. Reduce the polynomial by one order by factoring out
x.)
The order and the coefficients are
not preserved by the program.