Post Reply 
(12C) Modulo Operation
06-30-2024, 05:15 AM
Post: #1
(12C) Modulo Operation
Modulo (MOD) operation returns the remainder of a division.

All the HP Voyager Series (10, 11, 12 and 15) not include

the MOD function except the 16.

------------------------------------------------------------------

Let's calculate this MOD Operation manually.

example: 1155 MOD 13

1155 [ENTER] 13

►[ENTER] [ENTER] [-] [R↓] [X<>Y] [LSTx] [÷] [INTG] [x] [-]

Display Answer 11

With this manually key in operation can be easily input those
keys sequence as a program start from ► the whole line.
------------------------------------------------------------------
Once key in as a program let's try one more example.

How many years from 1983 to 2024 instead of simple subtraction
let's use this MOD operation.

2024 [ENTER] 1983 [R/S] display answer 41
-------------------------------------------------------------------

Gamo 6/2024
Find all posts by this user
Quote this message in a reply
06-30-2024, 11:20 AM (This post was last modified: 06-30-2024 11:22 AM by C.Ret.)
Post: #2
RE: (12C) Modulo Operation
(06-30-2024 05:15 AM)Gamo Wrote:  Let's calculate this MOD Operation manually.
example: 1155 MOD 13
1155 [ENTER] 13 ► [ENTER] [ENTER] [-] [R↓] [X<>Y] [LSTx] [÷] [INTG] [x] [-] ► Display Answer 11

May I suggest a slightly shorter alternative solution to use from the ► starting point:
[Image: attachment.php?aid=13676]


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
06-30-2024, 04:30 PM
Post: #3
RE: (12C) Modulo Operation
(07-31-2018 06:10 PM)Albert Chan Wrote:  Register Y X --> X Mod(Y, X)

Keep pressing R/S, eventually it display 0, previous Mod was Gcd (Rotate key to get it back)

Code:
                ; HP-12C Mod Program: Y X --> X Mod(Y, X)
Enter Enter     ; Y X X X
- LastX +       ; Y Y X X
Rotate          ; X Y Y X
/ LastX Swap    ; X Y X Y/X
Int * -         ; X X X Mod(Y,X)

From my old post, we can have mod get gcd as well
Find all posts by this user
Quote this message in a reply
Post Reply 




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