diff --git a/src/machine/arithmetic_ops.rs b/src/machine/arithmetic_ops.rs index d1f764d6..92e9c599 100644 --- a/src/machine/arithmetic_ops.rs +++ b/src/machine/arithmetic_ops.rs @@ -850,15 +850,9 @@ pub(crate) fn modulus(x: Number, y: Number, arena: &mut Arena) -> Result Integer { - if n1 > &Integer::ZERO && n2 < &Integer::ZERO { - ((n1 - Integer::ONE) / n2) - Integer::ONE - } else if n1 < &Integer::ZERO && n2 > &Integer::ZERO { - ((n1 + Integer::ONE) / n2) - Integer::ONE - } else { - let ring = ConstDivisor::new(n2.unsigned_abs()); - let n1 = n1.clone(); - IBig::from(ring.reduce(n1).residue()) - } + let ring = ConstDivisor::new(n2.unsigned_abs()); + let n1 = n1.clone(); + IBig::from(ring.reduce(n1).residue()) } match (x, y) {