Post Reply 
Power-of-two fraction handling for the 41C
02-01-2016, 08:43 PM
Post: #10
RE: Power-of-two fraction handling for the 41C
I took Dieter's code and added a check for the trivial case of calling the function with an integer. It now returns just the integer rather than the integer + "0/1". I won't bother saving/recalling flags as I keep the calculator in FIX 4 most of the time anyway. Hopefully Dieter will be along soon to clean up the mess I made of his code. It now has too many labels and jumps for my liking.

Code:
01 LBL "D2F"
02 RCL 00
03 *
04 FIX 0
05 CF 29
06 RND
07 RCL 00
08 FS? 04
09 GTO 02
10 RCL Y
11 RCL Y
12 LBL 01
13 MOD
14 LASTX
15 X<>Y
16 X≠0?
17 GTO 01
18 +
19 ST/ Z
20 /
21 LBL 02
22 RCL Y
23 RCL Y
24 /
25 ENTER
26 INT
27 " "
28 ARCL X
29 RDN
30 RDN
31 MOD
32 X=0?
33 GTO 03
34 LASTX
35 "├ "
36 ARCL Y
37 "├/"
38 ARCL X
39 GTO 04
40 LBL 03
41 LASTX
42 LBL 04
43 R↑
44 FIX 4
45 SF 29
46 AVIEW
47 END

David Brunell
Houston, Texas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Power-of-two fraction handling for the 41C - quantalume - 02-01-2016 08:43 PM



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