
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.
Содержание 48GII
Страница 1: ...hp 48gII graphing calculator user s guide H Edition 4 HP part number F2226 90020 ...
Страница 162: ...Page 3 37 Define this function by any of the means presented above and check that g 3 3 g 1 0 g 1 0 g 3 9 ...
Страница 201: ...Page 5 30 LIN LNCOLLECT POWEREXPAND SIMPLIFY ...
Страница 381: ...Page 11 55 Function KER Function MKISOM ...
Страница 461: ...Page 13 26 In the right hand side figure above we are using the line editor to see the series expansion in detail ...
Страница 777: ...Page 26 8 ...
Страница 840: ...Page L 5 ...