HP Forums
(35s) Long Division - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (35s) Long Division (/thread-22272.html)



(35s) Long Division - Gamo - 09-04-2024 06:31 AM

Just a simple program to calculate Long Division.

User [Input A] for "Dividend" and [Input B] for "Divisor"

Program will find the "Quotient and Remainder"

Answer display Quotient on top line and Remainder bottom line.
----------------------------------------------------------------------
Usage: DISPLAY Fix 0

GTO . . // to start program from the top

[R/S] display A? input Dividend
[R/S] display B? input Divisor
[R/S] display Answer Q on top and R on the bottom
-----------------------------------------------------------
Example: 1234567890 ÷ 987

[R/S] A? 1234567890
[R/S] B? 987

[R/S] display answer 1250828 and 654

Quotient is 1250828
Remainder is 654
-----------------------------------------------------------
Program
Quote:0001 INPUT A
0002 INPUT B
0003 INT÷
0004 RCL A
0005 RCL B
0006 RMDR

Remark:
This is my first program to try with the HP 35s since I only got this
calculator as an app on my PC.

Another example: 77088077 ÷ 7717

Q = 9989
R = 2964

Gamo 9/2024


RE: (35s) Long Division - PedroLeiva - 09-04-2024 11:11 AM

Very nice program Gamo, congratulations!! HP-35s is a wonderful calc, the app works just the same as the physical device. Pedro


RE: (35s) Long Division - Gamo - 09-04-2024 02:07 PM

Pedro Thank You

More program for this HP 35s is coming soon.

Thank You

Gamo


RE: (35s) Long Division - Gamo - 09-05-2024 04:13 AM

Program updated from Post #1

This program use stack only.

Example: 257803 ÷ 101

GTO . .

257803 [ENTER] 101 [R/S] display answer 2552 and 51

Q = 2552
R = 51

Program:
Quote:001 X<>Y
002 ENTER
003 ENTER
004 R↑
005 INT÷
006 LASTx
007 R↑
008 X<>Y
009 RMDR

Gamo


RE: (35s) Long Division - Thomas Klemm - 09-05-2024 05:26 AM

This saves one step:
Code:
001 X<>Y
002 ENTER
003 ENTER
004 R↑
005 INT÷
006 X<>Y
007 LASTx
008 RMDR