Post Reply 
mixed fraction program for hp 28s
10-11-2024, 02:51 PM
Post: #6
RE: mixed fraction program for hp 28s
(10-11-2024 08:44 AM)Thomas Klemm Wrote:  Something like this?
Code:
DIR
  R\->N
    \<< \->NUM \-> a
      \<< a IP \->STR
        IF a FP
        THEN "+" + a FP FRAC O\->S +
        END S\->N
      \>>
    \>>
  FRAC
    \<< \-> a
      \<< (0,1) (1,1)
        WHILE DUP2 + DUP C\->R / DUP a \=/
        REPEAT
          IF a <
          THEN SWAP ROT
          ELSE SWAP
          END DROP
        END DROP ROT DROP SWAP DROP C\->R
      \>>
    \>>
  O\->S
    \<< "/" SWAP + +
    \>>
  S\->N
    \<< "'" SWAP OVER + + STR\->
    \>>
END

Examples

3.8
R→N

'3+4/5'

'π^2/6'
R→N

'1+727069/1127354'


Warning: Don't try negative numbers.

i was getting syntax error and the cursor is placed at the parenthesis (1,1) i changed the commas in both parentheses to a point but then it returns a syntax error with cursor placed at the very end of the program..
is it working on your calculator?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
mixed fraction program for hp 28s - Rafa - 10-10-2024, 07:46 PM
RE: mixed fraction program for hp 28s - Rafa - 10-11-2024 02:51 PM



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