pierwill / gaussiant

Gaussian integers in Rust.
https://crates.io/crates/gaussiant
1 stars 1 forks source link

Create a testing macro for `is_gaussiant_prime` #9

Closed pierwill closed 2 years ago

pierwill commented 2 years ago

Use list of G. primes with |a|,|b|<=5 from here.

I'd like to be able to do something like this:

test_is_gaussian_prime!(
    -5-4i
    -5-2i
    -5+2i
    -5+4i
    -4-5i
    -4-i
    -4+i
    -4+5i
    -3-2i
    -3
    -3+2i
    -2-5i
    -2-3i
    -2-i
    -2+i
    -2+3i
    -2+5i
    -1-4i
    -1-2i
    -1-i
    -1+i
    -1+2i
    -1+4i
    -3i
    3i
    1-4i
    1-2i
    1-i
    1+i
    1+2i
    1+4i
    2-5i
    2-3i
    2-i
    2+i
    2+3i
    2+5i
    3-2i
    3
    3+2i
    4-5i
    4-i
    4+i
    4+5i
    5-4i
    5-2i
    5+2i
    5+4i
)
pierwill commented 2 years ago

Decided to write it out in https://github.com/pierwill/gaussiant/commit/1c9476617b0c903ebbd6da2de3b9b14b6dfe5821.