[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
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
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
 « Next Oldest | Next Newest »

 Messages In This Thread [TI-59/58] Percentage calculation. - hp41cx - 05-23-2016, 01:46 AM RE: [TI-59/58] Percentage calculation. - Gene - 05-23-2016, 02:08 AM RE: [TI-59/58] Percentage calculation. - Dieter - 05-23-2016 01:59 PM RE: [TI-59/58] Percentage calculation. - hp41cx - 05-23-2016, 03:54 PM RE: [TI-59/58] Percentage calculation. - Gene - 05-23-2016, 11:18 PM RE: [TI-59/58] Percentage calculation. - hp41cx - 05-24-2016, 12:54 AM RE: [TI-59/58] Percentage calculation. - Dieter - 05-24-2016, 09:48 AM RE: [TI-59/58] Percentage calculation. - hp41cx - 05-24-2016, 10:20 AM RE: [TI-59/58] Percentage calculation. - Dieter - 05-24-2016, 12:24 PM RE: [TI-59/58] Percentage calculation. - HrastProgrammer - 06-01-2016, 07:45 AM RE: [TI-59/58] Percentage calculation. - Pierre - 05-30-2016, 06:05 PM RE: [TI-59/58] Percentage calculation. - hp41cx - 06-01-2016, 10:52 AM RE: [TI-59/58] Percentage calculation. - Dieter - 06-01-2016, 12:17 PM RE: [TI-59/58] Percentage calculation. - HrastProgrammer - 06-01-2016, 04:23 PM RE: [TI-59/58] Percentage calculation. - HrastProgrammer - 06-01-2016, 04:33 PM RE: [TI-59/58] Percentage calculation. - Gene - 06-01-2016, 06:30 PM RE: [TI-59/58] Percentage calculation. - hp41cx - 06-02-2016, 01:13 AM RE: [TI-59/58] Percentage calculation. - HrastProgrammer - 06-02-2016, 03:57 AM RE: [TI-59/58] Percentage calculation. - Dieter - 06-02-2016, 12:07 PM RE: [TI-59/58] Percentage calculation. - HrastProgrammer - 06-02-2016, 05:05 AM

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