Post Reply 
(50g) USER key ": division" a) decimal into (pi) fractions b) no limits
12-29-2020, 01:39 PM
Post: #3
RE: HP50G USER key ": division" a) decimal into (pi) fractions b) no limits
To get fractions from decimals
Just forgot to add RAD instruction at the beginning:

\<< RCLF \-> x f
\<< RAD x TYPE 9 \=/
IF
THEN x DUP DUP ABS 1 <
IF
THEN \->Q
ELSE \->Q DUP PROPFRAC
END
ELSE x DUP PROPFRAC DUP2 SAME
IF
THEN DROP
END
END f STOF
\>>
\>>
65.1 ASN

To get full decimals from 'integer fractions'
Just forgot to add RAD instruction at the beginning:

\<< DUPDUP \->NUM SWAP \->STR DUP SIZE RCLF \-> x s f
\<< RAD -105 CF 2 s 1 -
START x "." POS DUP x 1 ROT 1 - SUB x ROT 1 + s SUB + 'x' STO
NEXT x OBJ\-> 100 ALOG * PROPFRAC PROPFRAC -105 SF DUP TYPE 9 ==
IF
THEN OBJ\-> 3 DROPN
END f STOF
\>>
\>>
65.3 ASN

In that way, the key user assignment program should not ask anymore for RAD mode conversion, restoring however at the end the initial flags values.

Regards,
Gil
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP50G USER key ": division" a) decimal into (pi) fractions b) no limits - Gil - 12-29-2020 01:39 PM



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