Make it line

This commit is contained in:
Adrián Arroyo Calle
2021-08-20 12:40:27 +02:00
parent 3c5a94452a
commit 9bcc56e337

View File

@@ -118,6 +118,7 @@ impl Integer {
Integer(num_integer::Integer::gcd(&self.0, &other.0))
}
#[inline]
pub fn count_ones(&self) -> Option<u32> {
Some(self.0.to_u32_digits().1.iter().map(|&d| d.count_ones()).sum())
}