]> git.lizzy.rs Git - rust.git/blobdiff - src/libnum/bigint.rs
auto merge of #15999 : Kimundi/rust/fix_folder, r=nikomatsakis
[rust.git] / src / libnum / bigint.rs
index acba750aaf4ac0d745f2c0b8014188050f1932b5..4dd3817e475ed7ade94875bfb85b1773bc1736f5 100644 (file)
@@ -514,9 +514,14 @@ fn gcd(&self, other: &BigUint) -> BigUint {
     #[inline]
     fn lcm(&self, other: &BigUint) -> BigUint { ((*self * *other) / self.gcd(other)) }
 
-    /// Returns `true` if the number can be divided by `other` without leaving a remainder.
+    /// Deprecated, use `is_multiple_of` instead.
+    #[deprecated = "function renamed to `is_multiple_of`"]
     #[inline]
-    fn divides(&self, other: &BigUint) -> bool { (*self % *other).is_zero() }
+    fn divides(&self, other: &BigUint) -> bool { return self.is_multiple_of(other); }
+
+    /// Returns `true` if the number is a multiple of `other`.
+    #[inline]
+    fn is_multiple_of(&self, other: &BigUint) -> bool { (*self % *other).is_zero() }
 
     /// Returns `true` if the number is divisible by `2`.
     #[inline]
@@ -1112,9 +1117,14 @@ fn lcm(&self, other: &BigInt) -> BigInt {
         BigInt::from_biguint(Plus, self.data.lcm(&other.data))
     }
 
-    /// Returns `true` if the number can be divided by `other` without leaving a remainder.
+    /// Deprecated, use `is_multiple_of` instead.
+    #[deprecated = "function renamed to `is_multiple_of`"]
+    #[inline]
+    fn divides(&self, other: &BigInt) -> bool { return self.is_multiple_of(other); }
+
+    /// Returns `true` if the number is a multiple of `other`.
     #[inline]
-    fn divides(&self, other: &BigInt) -> bool { self.data.divides(&other.data) }
+    fn is_multiple_of(&self, other: &BigInt) -> bool { self.data.is_multiple_of(&other.data) }
 
     /// Returns `true` if the number is divisible by `2`.
     #[inline]