numlib::order
-- order of a
residue classnumlib::order
(a,m)
returns the order of
the residue class modulo m
of a
in the group
of units modulo m
if a
and m
are
coprime.
numlib::order(a, m)
a |
- | an integer |
m |
- | a natural number |
numlib::order
(a,m)
returns a natural
number if a
is coprime to m
, and FAIL
if a
is not
coprime to m
.
numlib::order
(a,m)
returns the function
call with its arguments evaluated if a
or m
is not a number.numlib::order
returns an error if one of the arguments
evaluates to a number of wrong type.We compute the order of the residue class of in the unit group modulo :
>> numlib::order(23, 2161)
2160
We compute the order of all elements in the unit group modulo :
>> map([$ 1..12],numlib::order,13)
[1, 12, 3, 6, 4, 12, 12, 4, 3, 6, 12, 2]
The residue class of 7 modulo isn't a unit in the ring :
>> numlib::order(7,21)
FAIL
numlib::order
uses ifactor
and numlib::phi
.