Post Reply 
(50g) USER key ": division" a) decimal into (pi) fractions b) no limits
01-01-2021, 07:52 AM
Post: #8
RE: HP50G USER key ": division" a) decimal into (pi) fractions b) no limits
HP49-50G

New version to get the full digits when
you write '12/7' or other more complicate expressions.

Now, possible to use decimals when multiplying or dividing.

Example possible : '12.7*7.97'
LS-User
Division-Key

When dots, impossible expression :
'12.7*7.97+8'.
The result without the dots should be a multiple
equal exactly to 1, 10, 100,1000,10000, etc. (or the exact inverse of those values) of the original expression with the dots.

Possible solution, after manual transmission:
'127*797+8000'
LS-User
Division-Key

Recommended solution:
use always the division sign (/).
'127/10+797/100+8'
LS-User
Division-Key

Observation 1
Always write the sign ' at the beginning and at the end of the expression.

Observation 2
Any mode is allowed.
You can enter for example '5*3/7' or '5.*3/7'.

Observation 3
When copying the program, it is the only time when the exact mode should be on.
In other words, -105. CF (with a dot after 105) is not allowed inside the program when copying the program (only allowed integers without dots like here -105 CF).

Code
\<< DUP 0 0 0 RCLF \-> x1 x2 x21 num f
\<< RAD -105 CF x1 \->STR "." "" SREPL 0 ==
IF
THEN DROP
ELSE OBJ\-> 'x2' STO x2 x1 / \->NUM LOG DUP FP 0 \=/
IF
THEN DROP "Instead of decimals (ab.c),

Try fractions
('abc/10') !" DOERR
END \->STR "." "" SREPL DROP OBJ\-> ALOG 'x21' STO
IF x21 1 >
THEN x2 x21 /
ELSE
IF x21 1 <
THEN x2 x21 INV *
ELSE x2
END
END \->STR "." "" SREPL DROP OBJ\->
END DUP EXPAND DUP2 SAME
IF
THEN DROP
END DUP \->NUM DUP 'num' STO num ABS 100000000000 > num FP 0 \=/ OR
IF
THEN OVER 10 100 ^ * PROPFRAC PROPFRAC -105 SF DUP TYPE 9 ==
IF
THEN OBJ\-> 3 DROPN
END
ELSE DROP
END f STOF
\>>
\>>
65.3 ASN

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 - 01-01-2021 07:52 AM



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