<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0047)http://members.tripod.co.uk/rfam/wide/decon.txt -->
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR></HEAD>
<BODY><XMP># This program listing is CTF compliant and Xchange compatible.
# To be able to open this file in Xchange, rename the extension to .CTF.

# TITLE:  Repeating Decimal to Fraction Conversion
# AUTHOR: Roy F.A. Maclean
#   This is a shortened version of a program
#   by Ian Klassen ([email protected]) available at
#   http://www-personal.umich.edu/~hjo/casio/fracik.txt
# EMAIL:  [email protected]
# WEB:    http://members.tripod.co.uk/rfam
# DATE:   17Dec1995, 3Feb1997, 13Jan2000, 18Jan2000
# MAKE:   CASIO
# MODEL:  Any
# SIZE:   27
# NOTES:  There are two versions of this program.
#         If your calculator does not have a fraction facility
#         then type in program areas 2 and 0,
#         otherwise just use area 1.

#         If you want to know the fraction for
#         0.123123123123
#         then enter 0.123 at the first prompt and
#         enter 3 at the period prompt.
#         If you want to know the fraction for
#         0.123001230012300
#         then do same as above but with period 5.
#         When program is run and fraction is displayed then
#         pressing the fraction button will alternate between the
#         decimal and fractional representation.

# Use fraction symbol for %
# Program 0 is the euclidean algorithm subroutine.
# Use the reciprocal symbol for \^-1 or use Int (X/Y) instead.

@@ Program 1

?->A:"P"?->P
10^P-1
(Int (A Ans+1))%Ans

@@ Program 2

?->A:"P"?->P
10^P-1->T
(Int (AT+1))->S
S->X:T->Y
Prog 0
"NUM":S/X_
"DEN":T/X

@@ 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
 
 
 

</XMP></BODY></HTML>
 

Hosted by www.Geocities.ws

1