Convert decimal number to rational: Difference between revisions

m
Line 2,750:
 
=={{header|RPL}}==
FromStarting with HP-48 versions, the conversion can be performed directly acheived with the <code>→Q</code> instruction. HP-Earlier modelsversions shallmust useinstead instaeduse the following code, which is based on continuouscontinued fractions.
{{works with|Halcyon Calc|4.2.8}}
{| class="wikitable"
Line 2,769:
"'" OVER RE sign * →STR + "/" +
SWAP IM →STR + STR→
≫ ≫ '<span style="color:blue">'''→PQ'''</span>' STO'' STO
|
<span style="color:blue">'''→PQ'''</span> ''( x → 'p/q' ) ''
1,150

edits