Post Reply 
(41CX w/Advantage Pac) Feet inches fractions
06-27-2022, 06:40 PM
Post: #5
RE: (41CX w/Advantage Pac) Feet inches fractions
Nice to see it's working for you now.

(06-27-2022 01:25 AM)Xorand Wrote:  The code starts out by recalling 00 and multiplying it by x, adding 0.5, then dividing by register 00.

You missed taking the integral part with INT:
Code:
RCL 00
*
0.5
+
INT
RCL 00
/

This multiplies the number by the maximum denominator and rounds it to the nearest integer.
It makes sure we end up with nice fractions.

Later on the fraction is reduced if possible:
Code:
RCL 00
*
STO 01
RCL 00
STO 02
LBL 03
RCL 01
2
MOD
X>0?
GTO 04
2
ST/ 01
ST/ 02
GTO 03
LBL 04

We could use just .5 instead of 0.5 to save a precious byte and omit the redundant RTN statement at the END to save another one.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (41CX w/Advantage Pac) Feet inches fractions - Thomas Klemm - 06-27-2022 06:40 PM



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