From 09fafcb573ec6885d801eb70f1681d1696baa8dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ki=C3=ABd=20Llaentenn?= Date: Fri, 8 Oct 2021 20:03:30 +0000 Subject: [PATCH] Fix compilation errors when rug feature is disabled --- kalk/src/prelude/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kalk/src/prelude/mod.rs b/kalk/src/prelude/mod.rs index 46c8a3c..5f16cec 100644 --- a/kalk/src/prelude/mod.rs +++ b/kalk/src/prelude/mod.rs @@ -507,8 +507,8 @@ pub mod funcs { } if x.has_imaginary() || y.has_imaginary() { - if x.value.clone().fract() != 0 || y.value.clone().fract() != 0 - || x.imaginary_value.clone().fract() != 0 || y.imaginary_value.clone().fract() != 0 { + if x.value.clone().fract() != 0f64 || y.value.clone().fract() != 0f64 + || x.imaginary_value.clone().fract() != 0f64 || y.imaginary_value.clone().fract() != 0f64 { // Not a Gaussian integer! // TODO: throw an actual error instead of returning NaN return KalkNum::from(f64::NAN); @@ -530,7 +530,7 @@ pub mod funcs { } let mut c = a.clone().div_without_unit(b.clone()); - if c.imaginary_value.clone().fract() == 0 { + if c.imaginary_value.clone().fract() == 0f64 { KalkNum::new_with_imaginary(b.value.abs(), &b.unit, b.imaginary_value) } else { c.value = c.value.round(); @@ -545,7 +545,7 @@ pub mod funcs { // Euclidean GCD algorithm, but with modulus let mut x_a = x.clone(); let mut y_a = y.clone(); - while !y_a.value.eq(&0) { + while !y_a.value.eq(&0f64) { let t = y_a.value.clone(); y_a.value = x_a.value % y_a.value; x_a.value = t;