numlib::msqrts
-- modular square
rootsnumlib::msqrts
(a,m)
returns the list of
all integers 0 <= x <= m-1 such that (x^2-a) mod
m = 0.
numlib::msqrts(a, m)
a |
- | an integer |
m |
- | a natural number relatively prime to
a |
numlib::msqrts
(a,m)
returns a list of
nonnegative integers
numlib::lincongruence
,
numlib::mroots
numlib::msqrts
(a,m)
returns the function
call with evaluated arguments if one of the arguments is not a
number.numlib::msqrts
returns an error if the arguments
evaluate to numbers which are not both of the correct type.Computing the square roots of modulo :
>> numlib::msqrts(132132,3231227)
[219207, 3012020]
There are no square roots of modulo :
>> numlib::msqrts(222222,324899)
[]
Computing the square roots of modulo :
>> numlib::msqrts(37,48884)
[383, 585, 23857, 24059, 24825, 25027, 48299, 48501]
numlib::msqrts
uses D. Shanks' algorithm
RESSOL.