imaginarymiko / gaussian-factorise

Program for factorising Gaussian integers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gaussian Integer Factoriser (C++)

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)

I included a Python version in /src if that is of any use as well

About

Program for factorising Gaussian integers


Languages

Language:C++ 94.7%Language:Makefile 5.3%