Convert decimal number to rational: Difference between revisions
Content added Content deleted
m (→{{header|RPL}}: typo) |
|||
Line 2,750: | Line 2,750: | ||
=={{header|RPL}}== |
=={{header|RPL}}== |
||
Starting with HP-48 versions, the conversion can be performed directly with the <code>→Q</code> instruction. Earlier versions must instead use the following code, which is based on continued fractions. |
|||
{{works with|Halcyon Calc|4.2.8}} |
{{works with|Halcyon Calc|4.2.8}} |
||
{| class="wikitable" |
{| class="wikitable" |
||
Line 2,769: | Line 2,769: | ||
"'" OVER RE sign * →STR + "/" + |
"'" OVER RE sign * →STR + "/" + |
||
SWAP IM →STR + STR→ |
SWAP IM →STR + STR→ |
||
≫ ≫ '<span style="color:blue"> |
≫ ≫ '<span style="color:blue">→PQ</span>' STO |
||
| |
| |
||
<span style="color:blue">'''→PQ'''</span> ''( x → 'p/q' ) '' |
<span style="color:blue">'''→PQ'''</span> ''( x → 'p/q' ) '' |