## `numlib::isquadres` -- test for quadratic residues

#### Introduction

If the integer number `a` is a quadratic residue modulo the natural number `m` `numlib::isquadres``(a,m)` returns `TRUE` if the integer number `a` is a quadratic residue modulo the natural number `m`, and `FALSE` otherwise.

#### Call(s)

`numlib::isquadres(a, m)`

#### Parameters

`a` | - | an integer
`m` | - | a natural number coprime to `a`

#### Returns

`numlib::isquadres` returns `TRUE`, `FALSE`, or the function call with its arguments evaluated.

#### Related Functions

`numlib::legendre`, `numlib::jacobi`, `numlib::msqrts`

#### Details

- If the integer number `a` is a quadratic residue modulo the natural number `m` `numlib::isquadres``(a,m)` returns `TRUE`, and if `a` is a quadratic non-residue modulo `m` `numlib::isquadres``(a,m)` returns `FALSE`.
- If `a` and `m` are not coprime `numlib::isquadres``(a,m)` returns an error.
- `numlib::isquadres` returns an error if the arguments evaluate to numbers which are not both of the correct type.
- `numlib::isquadres` returns the function call with its arguments evaluated if the arguments do not evaluate to numbers.

#### Example 1

is a quadratic residue modulo :

    >> numlib::isquadres(132132, 3231227)

                                       TRUE

#### Example 2

is a quadratic non-residue modulo :

    >> numlib::isquadres(222222,324899)

                                       FALSE

#### Example 3

is a quadratic residue modulo :

    >> numlib::isquadres(37,48884)

                                       TRUE

#### Changes

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000