Expose `BigUint::bits` through `BigInt`
This commit is contained in:
parent
9b0d4c91cb
commit
df34563eda
|
@ -2750,6 +2750,11 @@ impl BigInt {
|
||||||
str::from_utf8(buf).ok().and_then(|s| BigInt::from_str_radix(s, radix).ok())
|
str::from_utf8(buf).ok().and_then(|s| BigInt::from_str_radix(s, radix).ok())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Determines the fewest bits necessary to express the `BigInt`,
|
||||||
|
/// not including the sign.
|
||||||
|
pub fn bits(&self) -> usize {
|
||||||
|
self.data.bits()
|
||||||
|
}
|
||||||
|
|
||||||
/// Converts this `BigInt` into a `BigUint`, if it's not negative.
|
/// Converts this `BigInt` into a `BigUint`, if it's not negative.
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Reference in New Issue