numtheory(deprecated)/msqrt - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : numtheory(deprecated)/msqrt

numtheory(deprecated)

 msqrt
 modular square root

 Calling Sequence msqrt(x, n)

Parameters

 x, n - integers

Description

 • Important: The numtheory package has been deprecated.  Use the superseding command NumberTheory[ModularSquareRoot] instead.
 • The function msqrt will compute the square root of x $\mathbf{mod}n$. It finds an integer y such that ${y}^{2}=x\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{mod}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}n$ if possible, otherwise it returns FAIL.
 • The command with(numtheory,msqrt) allows the use of the abbreviated form of this command.

Examples

Important: The numtheory package has been deprecated.  Use the superseding command NumberTheory[ModularSquareRoot] instead.

 > $\mathrm{with}\left(\mathrm{numtheory}\right):$
 > $\mathrm{msqrt}\left(3,11\right)$
 ${5}$ (1)
 > $\mathrm{msqrt}\left(3,7\right)$
 ${\mathrm{FAIL}}$ (2)

 See Also