mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-06-26 20:52:29 +02:00
Fix compilation errors when rug feature is disabled
This commit is contained in:
parent
c903e733e1
commit
a248b0f328
@ -519,8 +519,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);
|
||||
@ -542,7 +542,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();
|
||||
@ -557,7 +557,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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user