Post Reply 
[TI-59/58] Percentage calculation.
05-23-2016, 01:59 PM (This post was last modified: 05-23-2016 02:32 PM by Dieter.)
Post: #3
RE: [TI-59/58] Percentage calculation.
(05-23-2016 02:08 AM)Gene Wrote:  Very nice use of the TI-58/59 Hierarchical registers!

For those who never heard about the HIR commands and their use: take a look here.

So the HIR sequence in the program can be entered this way:

Code:
Enter this                 get that

key   code                 cmd   code
----------                 ----------
 STO   42                  HIR    82
 82    82                  03     03    ' store percentage in H3
  3    03                  HIR    82
 STO   42    delete all    11     11    ' recall base number from H1
 82    82    STO commands  HIR    82
  A    11    (code 42)     43     43    ' multiply by percentage in H3
 STO   42    and get =>    HIR    82
 82    82                  13     13    ' recall result from H3
 RCL   43
 82    82
  C    13

Hint: the program assumes there are no other pending operations. To be sure, press [CLR] or [=] before using this program.

Question to the TI experts: would it be possible to directly multiply percentage and base number within H2? And do the division by 100 also in H2 (by a HIR 62) in order to recall the final result from there? My idea is something like this:

Code:
150 [+] 17 [A]  =>  25,50
    [=]         => 175,50

Edit: I have absolutely no idea if this may work, but you get the idea (in this case still using the third hierarchy register).

Code:
000 76 LBL
001 11 A
002 82 HIR
003 03 03   ' store % in H3
004 82 HIR
005 11 11   ' recall base
006 82 HIR
007 43 43   ' multiply by %
008 93 .
009 00 0
010 01 1
011 82 HIR
012 43 43   ' multiply (base * %) by 0.01
013 83 HIR
014 13 13   ' recall result
015 82 HIR
016 02 02   ' store this as 2nd operand in H2
017 91 R/S

Please let me know if (and why) this will not work – and how to make it work. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [TI-59/58] Percentage calculation. - Dieter - 05-23-2016 01:59 PM



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