Approximates real numbers as fractions using continued fraction algorithm. With sufficiently high accuracy, rational numbers should get exact solutions. Inputs: X: decimal to convert ACC: precision level Outputs: Y: numerator X: denominator LASTX: X input Registers: 00: X input 01: current convergent 02: current coefficient 03: previous numerator 04: current numerator 05: previous denominator 06: current denominator 00 { 79-Byte Prgm } 01>LBL ">FRAC" 02 INPUT "ACC" 03 Rv 04 CLRG 05 STO 00 06 1 07 STO 04 08 STO 05 09 RCL 00 10>LBL A 11 ENTER 12 IP 13 STO 02 14 - 15 X!=0? 16 1/X 17 STO 01 18 RCL 02 19 RCL× 06 20 RCL+ 05 21 X<> 06 22 STO 05 23 RCL 02 24 RCL× 04 25 RCL+ 03 26 X<> 04 27 STO 03 28 RCL 00 29 RCL 04 30 RCL/ 06 31 - 32 ABS 33 RCL "ACC" 34 X>=Y? 35 GTO B 36 RCL 01 37 GTO A 38>LBL B 39 RCL 00 40 STO ST L 41 RCL 04 42 RCL 06 43 END