## `numlib::divisors` -- divisors of an integer

#### Introduction

`numlib::divisors``(n)` returns the list of positive divisors of `n`.

#### Call(s)

`numlib::divisors(n)`

#### Parameters

`n` | - | integer

#### Returns

`numlib::divisors` returns a list of nonnegative integers.

#### Related Functions

`ifactor`, `numlib::numdivisors`, `numlib::tau`, `numlib::primedivisors`, `numlib::numprimedivisors`, `polylib::divisors`

#### Details

- If `a` is a non-zero integer then `numlib::divisors``(a)` returns the sorted list of all positive divisors of `a`.
- `numlib::divisors``(0)` returns `[0]`.
- `numlib::divisors` returns an error if the argument evaluates to a number of wrong type.

#### Example 1

We compute the list of all positive divisors of :

    >> numlib::divisors(72)

                     [1, 2, 3, 4, 6, 8, 9, 12, 18, 24, 36, 72]

#### Example 2

We compute the list of all positive divisors of :

    >> numlib::divisors(-63)

                               [1, 3, 7, 9, 21, 63]

#### Background

- Internally, `ifactor` is used for factoring `n`.

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