Post Reply 
Long Division program
08-26-2017, 05:54 PM (This post was last modified: 08-26-2017 06:03 PM by Dieter.)
Post: #2
RE: Long Division program
(08-25-2017 06:47 AM)Gamo Wrote:  Anyone have the idea on how to adapt this program to work on HP 12C will be nice.

?!? – where's the problem, this HP67 program (I suppose) can be used almost 1:1 on the 12C. OK, the 12C has no labels, so remove the first line. And there is no roll up command, but that's the same as 3x roll down. Since there is no subroutine call the final RTN here works as a R/S, so simply ignore it.

So if you want to you can directly use this program on the 12C, just with these minor modifications.

Or consider this alternate solution:

Code:
01 ENTER
02 ENTER
03 CLX
04 x
05 +
06 /
07 LstX
08 x<>y
09 INTG
10 ENTER
11 R↓
12 x
13 -
14 GTO 00

Hint: the first five lines fill T, Z and Y with the dividend while X holds the divisor.
More important: this procedure calculates the remainder without the FRAC function which is the preferred method since it does not cause roundoff errors.

4359 ENTER 57 [R/S] => 27 [x<>y] 76

Add a final [x<>y] if you want to have it the other way round.

Or add...

Code:
14 EEX
15 4
16 /
17 +
18 FIX 4
19 GTO 00

....and the result is displayed as 76,0027.

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


Messages In This Thread
Long Division program - Gamo - 08-25-2017, 06:47 AM
RE: Long Division program - Dieter - 08-26-2017 05:54 PM
RE: Long Division program - Dieter - 08-26-2017, 06:30 PM
RE: Long Division program - Gamo - 08-27-2017, 11:51 AM
RE: Long Division program - Dieter - 08-27-2017, 12:17 PM
RE: Long Division program - Gamo - 08-28-2017, 05:10 AM



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