# TITLE: Polynomial Division # AUTHOR: Roy F.A. Maclean # EMAIL: rfamgm at gmail # WEB: http://www.spiderpixel.co.uk/caspro # DATE: 13Aug1996 # MAKE: CASIO # MODEL: fx6300G or greater # # Enter the degree (must be less than or equal to eight) # of the polynomial on the numerator followed by its # coefficients. Then repeat for the denominator. The coefficients of # the quotient and remainder will be displayed. ## Program 1 ## This program is repeated below without comments, ## for compatibility with Xchange Lbl 0 Mcl ; the Mcl is important, don't miss out. "DEGNUM"?->A "DEGDEN"?->B B>A=>Goto 0 A>9=>Goto 0 ; this program can only handle up to degree 9 "COEFFSNUM" Lbl 1 ?->G[C] Isz C C<=A=>Goto 1 ; loop 1 stores first set of coefficients "COEFFSDEN" Lbl 2 ?->Q[D] Isz D D<=B=>Goto 2 ; loop 2 stores second set of coefficients "QUOTIENT" Lbl 3 ; loop 3 displays the quotient coeffs (the 'C' value) G[F]%Q->C_ ; use fraction symbol for % F->D:0->E Lbl 4 G[D]-CQ[E]->G[D] Isz D:Isz E ; loop 4 uses the 'C' from loop 3 to E<=B=>Goto 4 ; subtract from dividend Isz F A-F>=B=>Goto 3 "REM" Lbl 5 G[F]_ Isz F F<=A=>Goto 5 ; loop5 displays coeffs of remainder Goto 0 # ___________________________________ @@ Program 1 Lbl 0 Mcl "DEGNUM"?->A "DEGDEN"?->B B>A=>Goto 0 A>9=>Goto 0 "COEFFSNUM" Lbl 1 ?->G[C] Isz C C<=A=>Goto 1 "COEFFSDEN" Lbl 2 ?->Q[D] Isz D D<=B=>Goto 2 "QUOTIENT" Lbl 3 G[F]%Q->C_ F->D:0->E Lbl 4 G[D]-CQ[E]->G[D] Isz D:Isz E E<=B=>Goto 4 Isz F A-F>=B=>Goto 3 "REM" Lbl 5 G[F]_ Isz F F<=A=>Goto 5 Goto 0