Post Reply 
HP-50g Modular Arithmetic
02-07-2019, 02:42 PM (This post was last modified: 02-07-2019 02:43 PM by John Keith.)
Post: #6
RE: HP-50g Modular Arithmetic
The 50g's POWMOD command uses the CAS variable MODULO for the modulus. Joe Horn posted a program for another calculator (the Prime, I think) that accepts a user-input modulus but I can't find it at the moment. Here is my 50g version:

Code:

\<< PUSH CASDIR MODULO \-> M
  \<< MODSTO POWMOD
    IF DUP 0 <
    THEN MODULO +
    END M MODSTO POP
  \>>
\>>

Input is x, y, m to return (x^y) mod m.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP-50g Modular Arithmetic - Visty - 02-06-2019, 07:15 PM
RE: HP-50g Modular Arithmetic - pier4r - 02-06-2019, 09:26 PM
RE: HP-50g Modular Arithmetic - Gerald H - 02-07-2019, 05:21 AM
RE: HP-50g Modular Arithmetic - John Keith - 02-07-2019 02:42 PM



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