modular exponentiation?
|
07-09-2018, 05:18 AM
Post: #33
|
|||
|
|||
RE: modular exponentiation?
(07-08-2018 09:50 PM)Bill Duncan Wrote: Has anyone written a POWMOD -like function for the HP-48? Cf. Modular Arithmetic for the HP-48 Since PLUS is only used by TIMES it can be inlined. And then you can keep TIMES in a local variable leading to: Code: @POWER ( a b n -- a ^ b % n ) (07-09-2018 02:32 AM)Joe Horn Wrote: There's a "Fast Powering algorithm f exponentiation (mod n)" program called PWR in Anthony Shaw's "MODULO" package for the 48: https://www.hpcalc.org/details/6015 Quote:MODPND Thus I assume that it will work only up to 109. Quote:Just wondering before I go off and try it myself. Just go for it! And post your result. Cheers Thomas |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)