gcd: return NaN when encountering non-Gaussian integer

This commit is contained in:
Kiëd Llaentenn 2021-10-03 23:33:48 +00:00
parent ff496f105c
commit b26bced8fe

View File

@ -516,6 +516,8 @@ pub mod funcs {
if x.has_imaginary() || y.has_imaginary() {
if x.imaginary_value.fract() != 0 || y.imaginary_value.fract() != 0 {
// Not a Gaussian integer!
// TODO: throw an actual error instead of returning NaN
return KalkNum::from(NaNf64);
}
// TODO