Page 5-17
before operating on them. You can also convert any number into a ring
number by using the function EXPANDMOD. For example,
EXPANDMOD(125)
≡
5 (mod 12)
EXPANDMOD(17)
≡
5 (mod 12)
EXPANDMOD(6)
≡
6 (mod 12)
The modular inverse of a number
Let a number
k
belong to a finite arithmetic ring of modulus
n
, then the
modular inverse of
k
, i.e.,
1/k (
mod
n),
is a number
j
, such that
j
⋅
k
≡
1 (
mod
n
). The modular inverse of a number can be obtained by using the function
INVMOD in the MODULO sub-menu of the ARITHMETIC menu. For example,
in modulus 12 arithmetic:
1/6 (mod 12) does not exist.
1/5
≡
5 (mod 12)
1/7
≡
-5 (mod 12)
1/3 (mod 12) does not exist.
1/11
≡
-1 (mod 12)
The MOD operator
The MOD operator is used to obtain the ring number of a given modulus
corresponding to a given integer number. On paper this operation is written
as
m
mod
n = p
, and is read as “
m
modulo
n
is equal to
p
”. For example,
to calculate 15 mod 8, enter:
•
ALG mode:
15
MOD
8`
•
RPN mode:
15`8`
MOD
The result is 7, i.e., 15 mod 8 = 7. Try the following exercises:
18 mod 11 = 7
23 mod 2 =1
40 mod 13 = 1
23 mod 17 = 6
34 mod 6 = 4
One practical application of the MOD function for programming purposes is
to determine when an integer number is odd or even, since
n
mod 2 = 0, if
n
is even, and
n
mode 2 = 1, if
n
is odd. It can also be used to determine
when an integer
m
is a multiple of another integer
n
, for if that is the case
m
mod
n
= 0.
Содержание 49g+
Страница 1: ...hp 49g graphing calculator user s guide H Edition 4 HP part number F2228 90006 ...
Страница 197: ...Page 5 30 LIN LNCOLLECT POWEREXPAND SIMPLIFY ...
Страница 377: ...Page 11 55 Function KER Function MKISOM ...
Страница 457: ...Page 13 26 In the right hand side figure above we are using the line editor to see the series expansion in detail ...
Страница 775: ...Page 26 10 the location of the backup battery in the top compartment at the back of the calculator ...
Страница 838: ...Page L 5 ...