mixed fraction program for hp 28s
|
10-10-2024, 07:46 PM
Post: #1
|
|||
|
|||
mixed fraction program for hp 28s
Hello,
i found this program some time ago that gives a mixed fraction on hp 28s. After keying in the program it returned a syntax error. does anyone know what might be wrong with it, or better, have a working program to share? here's the malfunctioning one i've tried: "The following is the one that gives output like '3+4/5' for 3.8 << -> a << a IP ->NUM ->STR IF a ->NUM FP THEN "+" + a FP FRAC O->S + END S->N >> >> cheers! |
|||
10-10-2024, 08:15 PM
Post: #2
|
|||
|
|||
RE: mixed fraction program for hp 28s
I don't believe FRAC, O->S or S->N are valid commands.
|
|||
10-11-2024, 08:44 AM
Post: #3
|
|||
|
|||
RE: mixed fraction program for hp 28s
Something like this?
Code: DIR Examples 3.8 R→N '3+4/5' 'π^2/6' R→N '1+727069/1127354' Warning: Don't try negative numbers. |
|||
10-11-2024, 09:10 AM
Post: #4
|
|||
|
|||
RE: mixed fraction program for hp 28s
Addendum: Just remembered this older thread: fraction program hp 28s?
It contains also a program FRAC but I haven't checked if this would work here. |
|||
10-11-2024, 02:47 PM
Post: #5
|
|||
|
|||
RE: 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? 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? |
|||
10-11-2024, 04:13 PM
(This post was last modified: 10-11-2024 07:02 PM by Thomas Klemm.)
Post: #7
|
|||
|
|||
RE: mixed fraction program for hp 28s
(10-11-2024 02:51 PM)Rafa Wrote: I was getting syntax error and the cursor is placed at the parenthesis (1,1) You probably use a comma , instead of a period . as decimal point character. Either use a semicolon ; or just a space between the numbers: (0 1) (1 1) (10-11-2024 02:51 PM)Rafa Wrote: is it working on your calculator? It runs on an HP-48. I assumed it would run on an HP-28 too. If complex numbers don't work, you could try using vectors instead: [0 1] [1 1] And then use V→ instead of C→R to decompose them. |
|||
10-11-2024, 06:35 PM
(This post was last modified: 10-11-2024 07:06 PM by Gilles.)
Post: #8
|
|||
|
|||
RE: mixed fraction program for hp 28s
With my HP50g it could be :
Code: R→N : « DUP IP OVER FP →Q + » But perhaps →Q dont exists on the 28S ? Why use string objects while algebraic objects does the job ? |
|||
10-11-2024, 06:59 PM
Post: #9
|
|||
|
|||
RE: mixed fraction program for hp 28s | |||
10-11-2024, 07:15 PM
(This post was last modified: 10-11-2024 07:18 PM by Thomas Klemm.)
Post: #10
|
|||
|
|||
RE: mixed fraction program for hp 28s
(10-11-2024 06:35 PM)Gilles Wrote: With my HP50g it could be : Interestingly your program gives a different answer: 'π^2/6' →NUM R→N '1+78609550141/121887731137' Both results evaluate to the same initial value: 1.64493406685 Thus I wonder which algorithm is used in →Q. |
|||
10-11-2024, 07:33 PM
(This post was last modified: 10-11-2024 07:35 PM by Gilles.)
Post: #11
|
|||
|
|||
RE: mixed fraction program for hp 28s
(10-11-2024 06:59 PM)Steve Simpkin Wrote: Correct, →Q was not introduced until the HP-48SX.So we could perhaps create this one with the FRAC below, the algebraic 'A/B' and the OBSUB command I see in the 28s reference manuel. Just an idea, i dont own a 28S and OBSUB dont exist in the 48SX and 50g si In can't test. |
|||
10-11-2024, 07:58 PM
(This post was last modified: 10-11-2024 08:13 PM by Gilles.)
Post: #12
|
|||
|
|||
RE: mixed fraction program for hp 28s
(10-11-2024 07:15 PM)Thomas Klemm Wrote: Thus I wonder which algorithm is used in →Q.I don't know the algorithm but the accuracy of →Q depends on the FIX parameter. I was always impressed by its speed, even with my old 48SX. There is also a command →Qπ which allows to retrieve for example π/4 with the real value of ACOS (√2/2) in radians. And √2/2 →NUM →Qπ returns √(1/2) , then simplify returns √2/2 AUR says : Quote:To Quotient Command: Returns a rational form of the argument. And for →Qπ Quote:To Quotient Times π Command: Returns a rational form of the argument, or a rational form of |
|||
10-11-2024, 08:10 PM
Post: #13
|
|||
|
|||
RE: mixed fraction program for hp 28s
(10-11-2024 06:35 PM)Gilles Wrote: Why use string objects while algebraic objects does the job ? The problem is that numbers can't be quoted. This is the best I could come up with: 4 5 O→S "4/5" S→N '4/5' But I agree, from this point on the integer part could just be added. Apart from a minor change I didn't bother to rewrite the main function but just added the missing ones to make it work. |
|||
10-11-2024, 08:17 PM
Post: #14
|
|||
|
|||
RE: mixed fraction program for hp 28s
(10-11-2024 08:10 PM)Thomas Klemm Wrote:(10-11-2024 06:35 PM)Gilles Wrote: Why use string objects while algebraic objects does the job ? What about : 'A' 1 {123} OBSUB does it returns '123' ? or perhaps 'A' 1 123 OBSUB |
|||
10-12-2024, 11:45 AM
(This post was last modified: 10-12-2024 11:46 AM by John Keith.)
Post: #15
|
|||
|
|||
RE: mixed fraction program for hp 28s | |||
10-13-2024, 06:56 PM
Post: #16
|
|||
|
|||
RE: mixed fraction program for hp 28s | |||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)