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
.
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.
./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)