9 push(cadr(p1
)); // 1st arg, p(x)
12 push(caddr(p1
)); // 2nd arg, q(x)
15 push(cadddr(p1
)); // 3rd arg, x
18 p1
= pop(); // default x
19 if (p1
== symbol(NIL
))
20 p1
= symbol(SYMBOL_X
);
26 //-----------------------------------------------------------------------------
30 // Input: tos-3 Dividend
36 // Output: tos-1 Quotient
38 //-----------------------------------------------------------------------------
50 U
**dividend
, **divisor
;
60 dividend
= stack
+ tos
;
64 m
= coeff() - 1; // m is dividend's power
66 divisor
= stack
+ tos
;
70 n
= coeff() - 1; // n is divisor's power
84 for (i
= 0; i
<= n
; i
++) {
85 push(dividend
[x
+ i
]);
90 dividend
[x
+ i
] = pop();
117 "quotient(x^2+1,x+1)-x+1",
120 "quotient(a*x^2+b*x+c,d*x+e)-(-a*e/(d^2)+a*x/d+b/d)",
127 test(__FILE__
, s
, sizeof s
/ sizeof (char *));