PDIV performs polynomial division.  Only 207 bytes and an ASCII
listing is included.


PDIV performs polynomial division for polynomials of any degree.
The coefficients of each polynomial are entered in list form.  For
example the polynomial:

       X^4 + 8X^3 - X + 1

is represented by the list  { 1, 8, 0, -1, 1 }.   Note well that a
zero is in place of the missing "X^2" element.

Running PDIV:
The program prompts you for two lists (N and D).  One list is the
numerator and the second is the denominator.  The first prompt is
for D.  Enter the list of coefficients for the first polynomial and
press ENTER.  Now enter the list of the coeffecients for the second
polynomial and again press ENTER.  What returns is the coefficient
quotient and remainder, both in list form.

Example
-------
Suppose you want to perform the following division:

            2X^3 - 5X^2 + X - 7
           ---------------------
               X^2 + 8X + 23


Press PDIV and wait for the "N?" prompt.  Enter the list
{ 2, -5, 1, -7 } and press ENTER.

The secont prompt, "D?", will appear.  Enter the list { 1, 8, 23 }
and press ENTER.

The quotient is the first list { 2, -21 } and the remainder,
{ 0, 0, 123, 476 } is the second list.  These two lists represent
the polynomial

        2X - 21  with a remainder of  123X + 476



If the lists are too large to view on the screen, you CANNOT use the
cursor keys to view the rest of the coefficients.  Instead, you must
recall the list(s) on the screen and then use the cursor keys.




NOTE:
The degree of the polynomial in the numerator must be equal to or
larger than the degree of the polynomial in the denominator.  You 
will receive otherwise.




Variables used in the PDIV program:
        Lists: N    the numerator list
               D    the denominator list
               D2   a "dummy" list used for scratch work
               Rem  the remainder list

        Reals: S1   the size of N
               S2   the size of D
               ND   the size of quotient list
               M    a scratch variable for temporary storage.
               I,J  loop counters

Final note:
This program can be used with any other program.  If used, please give
credit where credit is due.  Thanks.

Richard Homard

