Post Reply 
(12C) Decimal Expansion of a Fraction
01-11-2021, 01:01 PM (This post was last modified: 01-12-2021 06:59 AM by C.Ret.)
Post: #2
RE: (12C) Decimal Expansion of a Fraction
Nice !

I being in trouble when using a HP-12C, I am a bit more trained on HP-15C.

I still succeed in producing a shorter code than yours.

But the usage is a bit different; you have to enter the two values in the stack before running the program :

Code:
P/R
f CLEAR PRGRM
00-     
01-     44 0     STO 0
02-     42 0   f FIX 0
03-       34     x><y
04-       36     ENTER
05-       36     ENTER
06-     45 0     RCL 0
07-       10      ÷ 
08-    43 25   g Intg
09-       31     R/S
10-    45  0     RCL 0
11-       20      × 
12-       30      - 
13-        1      1
14-        0      0 
15-       20      × 
16-43,33 04      GTO 04
P/R

usage:
Code:
517656 [ENTER] 190435 [R/S]    [R/S] [R/S] [R/S] [R/S][R/S] ...
          2 ... 7 ... 1 ... 8 ... 2 ... 8 ... 1 ... 8 ... 2 ... 8 ... 4 ... 6 ...

Only register R0 is used; the trick is to use a double ENTER to kept a copy of the numerator in the stack, this allows to compute the remainder straightforward and of course the Goto repeat this trick forever.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (12C) Decimal Expansion of a Fraction - C.Ret - 01-11-2021 01:01 PM



User(s) browsing this thread: 1 Guest(s)