## `numlib::lincongruence` -- linear congruence

#### Introduction

For integers `a` and `b` and a nonzero integer `m` `numlib::lincongruence``(a,b,m)` returns the sorted list of all solutions of the linear congruence if this congruence is solvable. Otherwise `FAIL` is returned.

#### Call(s)

`numlib::lincongruence(a, b, m)`

#### Parameters

`a` | - | an integer
`b` | - | an integer
`m` | - | a non-zero integer

#### Returns

`numlib::lincongruence``(a,b,m)` returns a list of nonnegative integers if `a` and `b` are integers and `m` is a non-zero integer such that the linear congruence is solvable.

`numlib::lincongruence``(a,b,m)` returns `FAIL` if `a` and `b` are integers and `m` is a non-zero integer such that the linear congruence is not solvable.

`numlib::lincongruence``(a,b,m)` returns the function call with its arguments evaluated if one of the arguments is a symbolic expression.

#### Related Functions

`numlib::ichrem`, `numlib::mroots`, `numlib::msqrts`

#### Details

- `numlib::lincongruence``(a,b,m)` returns an error if one of the arguments evaluates to a number of wrong type.

#### Example 1

A linear congruence possessing one solution:

    >> numlib::lincongruence(7,19,23)

                                        [6]

#### Example 2

A linear congruence possessing several solutions:

    >> numlib::lincongruence(77,209,253)

                 [6, 29, 52, 75, 98, 121, 144, 167, 190, 213, 236]

#### Example 3

A linear congruence possessing no solutions:

    >> numlib::lincongruence(77,208,253)

                                       FAIL

#### Changes

- no changes

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