# 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`::`factorGaussInt`

Factorization of Gaussian integers

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::factorGaussInt(`n`)
```

## Description

`numlib::factorGaussInt(n)` returns the factorization of the Gaussian integer `n` into Gaussian primes. Among associate primes, that one with smallest polar angle is chosen.

## Examples

### Example 1

In the Gaussian integers, 3 remains prime while 5 does not:

`numlib::factorGaussInt(3), numlib::factorGaussInt(5)`

### Example 2

The argument to `numlib::factorGaussInt` may be any Gaussian integer, that is, every complex number of the form a + b i where a and b are integers:

`numlib::factorGaussInt(2+2*I)`

## Parameters

 `n` An integer, or a complex number whose real and imaginary part are integers

## Return Values

`numlib::factorGaussInt` returns a list ```[u, p1, a1, ..., pk, ak]``` where u is a unit in the Gaussian integers, the pi are Gaussian primes and the ai are positive integers, such that .

## Algorithms

The function `ifactor` is used to factor the norm; this step takes most of the running time. Hence, the running time of the algorithm mainly depends on the size of the prime factors of the norm of `n`.