# TITLE: Approximate Fraction # AUTHOR: Karl Ove Hufthammer # EMAIL: huftis@bigfoot.com # DATE: 17Sep1999, 13Jan2000 # MAKE: CASIO # MODEL: 9850 # NOTES: # # Just type in a number, and press EXE until you get a accurate enough # fraction. You can even get good a approximation for pi! # The program displays the numerator (stored in U), the denominator # (stored in V), the resulting number, the original number and the # difference between these two. @@ Program "APPFRAC" ClrText "N"?->A~B 1->R Do 10A->A 10R->R LpWhile Frac A<>0 1->S~Y 0->T~X Do A->M:R->A Int (M/A->Q M-QA->R QY+T->U QX+S->V U/V->Z B-Z->C ClrText Locate 2,1,U Locate 2,2,V Locate 2,3,"-------------" Locate 2,4,Z Locate 2,5,B Locate 2,6,"-------------" Locate 2,7,Abs C Do LpWhile Getkey<>31 Y->T:U->Y X->S:V->X LpWhile C<>0 Locate 2,7,"END"