# TITLE: Fraction Calculator # AUTHOR: Roy F.A. Maclean # EMAIL: rfamgm at gmail # WEB: http://www.spiderpixel.co.uk/caspro # DATE: 03Jan2000, 04Jan2000,13Jan2000, 18Jan2000 # MAKE: CASIO # MODEL: 7000G or other models without inbuilt fraction facilities # NOTES: Enter the numerators and denominators of your two fractions # and then choose an option 1-4 for what operation to do. # # Program 0 is the euclidean algorithm subroutine # which keeps the fractions in lowest possible terms. # Use the reciprocal symbol for \^-1 or use Int (X/Y) instead. @@ Program 1 "NUM 1"?->A "DEN 1"?->B "NUM 2"?->C "DEN 2"?->D "+-*/" "1234"?->E E=4=>Goto 4 E=3=>Goto 3 E=2=>goto 2 AD+BC->S BD->T Goto 5 Lbl 2 AD-BC->S BD->T Goto 5 Lbl 3 AC->S BD->T Goto 5 Lbl 4 AD->S BC->T Lbl 5 S->X:T->Y Prog 0 "ANS NUM" S/X_ "ANS DEN" T/X_ "DECIMAL" S/T @@ Program 0 1->A~B:0->C~D Lbl 1 Int XY\^-1 X-AnsY->R A-AnsD->E C-AnsB->F D->A:B->C:E->D F->B:Y->X:R->Y Y<>0=>Goto 1