The GaussInt package provides routines for working with Gaussian integers. Many of these commands are similar to commands from the NumberTheory package, but are designed to work with complex integers. The symbol capital is reserved for one of the square roots of -1: = .
Simple operators with complex integers are possible without any commands in the GaussInt package:
The GIquo command computes the integer quotient of m divided by n.
>
|
|
The GIrem command computes the integer remainder of m divided by n.
>
|
|
If the GIquo command is called with an optional third argument that specifies a name, the result for the remainder is stored in the given name. The converse is also true for the GIrem command:
>
|
|
The GIgcd command calculates the greatest common divisor of a sequence of Gaussian integers:
>
|
|
The GIdivisor command computes a set of divisors that are in the first quadrant of its Gaussian integer argument:
| (12) |
The GIfactor command returns the Gaussian integer factorization of c:
>
|
|
The GIprime command tests a value, z, for primality.
The GInorm command computes the norm of the Gaussian integer, z. The norm of a Gaussian integer = is defined as ||z|| = =