# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

# `numlib`::`msqrts`

Modular square roots

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

## Syntax

```numlib::msqrts(`a`, `m`)
```

## Description

`numlib::msqrts(a,m)` returns the list of all integers x ∈ {0, 1, …, m - 1} such that .

## Examples

### Example 1

Computing the square roots of 132132 modulo 3231227:

`numlib::msqrts(132132,3231227)`

### Example 2

There are no square roots of 222222 modulo 324899:

`numlib::msqrts(222222,324899)`

### Example 3

48884 is a composite number, so a number can have more than two square roots modulo 48884:

`numlib::msqrts(37,48884)`

## Parameters

 `a` An integer `m` A natural number relatively prime to `a`

## Return Values

`numlib::msqrts(a,m)` returns a list of nonnegative integers

## Algorithms

`numlib::msqrts` uses D. Shanks' algorithm RESSOL.