Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 1.02 KB

README.md

File metadata and controls

29 lines (22 loc) · 1.02 KB

Gaussian Integer Factoriser (C++)

Build:

This program requires C++23.

To build with support for modules (requires Clang and libc++), use the build.sh script, which calls CMake. To build without using modules, just run make.

Usage:

gaussian-factorise
gaussian-factorise <-h/-help/h/help>
gaussian-factorise <-r/-random/r/random>
gaussian-factorise [integer]

If no argument is given, the program will prompt the user for an Gaussian integer. If the provided Gaussian integer is "random" or "r", the program will generate a random integer. Otherwise, the argument will be interpreted as an integer.

The program will then factorise the integer into Gaussian primes.

Also accepts j as the imaginary unit. a + bi and bi + a are both accepted forms.

Examples:

./gaussian-factorise 2
Output: (-i)(1 + i)(1 + i)
./gaussian-factorise 7
Output: (7)
./gaussian-factorise 425 - 470i
Output: (-1)(1 + 2i)(2 + i)(94 + 85i)