# 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.

# numlib::order

Order of a residue class

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::order(a, m)

## Description

numlib::order(a,m) returns the order of the residue class modulo m of a in the group of units modulo m if a and m are coprime.

numlib::order(a,m) returns the function call with its arguments evaluated if a or m is not a number.

numlib::order returns an error if one of the arguments evaluates to a number of wrong type.

## Examples

### Example 1

We compute the order of the residue class of 23 in the unit group modulo 2161:

numlib::order(23, 2161)

### Example 2

We compute the order of all elements in the unit group modulo 13:

map([\$ 1..12],numlib::order,13)

### Example 3

The residue class of 7 is not a unit in the ring modulo 21:

numlib::order(7,21)

## Parameters

 a An integer m A natural number

## Return Values

numlib::order(a,m) returns a natural number if a is coprime to m, and FAIL if a is not coprime to m.

## Algorithms

numlib::order uses ifactor and numlib::phi.