Working with Complex Integers Using the GaussInt Package
While any command in the package can be referred to using the long form, for example, GaussInt:-GIgcd, it is often easier to load the package and then use the short form command names.
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 I is reserved for one of the square roots of -1: I = −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:
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 z = a+I⁢b is defined as ||z|| = a+I⁢b⁢a−I⁢b = a2+b2
Download Help Document