Convert decimal number to rational: Difference between revisions

m
→‎{{header|TI SR-56}}: Remove unnecessary indent
No edit summary
m (→‎{{header|TI SR-56}}: Remove unnecessary indent)
Line 2,964:
Annotated listing:
<syntaxhighlight lang="text">
STO 0 // Rational := User Input
0 STO 1 // Denominator := 0
*CP // RegT := 0
1 SUM 1 // Denominator += 1
RCL 1 * RCL 0 = Inv *Int // Find fractional part of Rational * Denominator
Inv *x=t 0 6 // If it is nonzero loop back to instruction 6
RCL 1 x<>t // Report denominator
RCL 0 * RCL 1 = // Report numerator
R/S // End
</syntaxhighlight>
 
27

edits