Go Library for Big Complex Number Computation

Good morning, good afternoon, and good evening, Gophers! Wish you have a good day! I have made my library for computing big complex numbers public. Please feel free to take a look :blush:

GitHub: https://github.com/tommytim0515/go-bigcomplex

Go Doc: https://pkg.go.dev/github.com/tommytim0515/go-bigcomplex

In the beginning, I was working with some cryptographic protocols, and I needed to write a Go program to compute the Lagrange four square sum of a very large integer (around 2000 bits in size). One step is calculating GCDs (Greatest Common Divisors) of Gaussian integers and GCRDs (Greatest Common Right Divisors) of Hurwitz quaternions/integers. Although Golang has built-in complex number types: complex64 and complex128, it cannot handle big integers because they are based on float64 and float128. So I implement my library for big complex numbers with math/big library. Currently, it only supports Gaussian integers and Hurwitz integers.

Its usage is similar to big.Int and big.Float. And it can perform addition, subtraction, multiplication, division, Euclidean algorithm (GCD), norm, etc.

It would be great if the library could help you with the work related to cryptography and large complex number calculations. And I wish people who love open source can help to enrich this library together to support more complex number types :slight_smile:

1 Like