Document BigInt's new and from_slice methods
Fixes https://github.com/mozilla/rust/issues/14639
This commit is contained in:
parent
7d07a1e74b
commit
75891274c4
1 changed files with 8 additions and 0 deletions
|
@ -653,6 +653,8 @@ impl FromStrRadix for BigUint {
|
||||||
|
|
||||||
impl BigUint {
|
impl BigUint {
|
||||||
/// Creates and initializes a `BigUint`.
|
/// Creates and initializes a `BigUint`.
|
||||||
|
///
|
||||||
|
/// The digits are be in base 2^32.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new(v: Vec<BigDigit>) -> BigUint {
|
pub fn new(v: Vec<BigDigit>) -> BigUint {
|
||||||
// omit trailing zeros
|
// omit trailing zeros
|
||||||
|
@ -665,6 +667,8 @@ impl BigUint {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates and initializes a `BigUint`.
|
/// Creates and initializes a `BigUint`.
|
||||||
|
///
|
||||||
|
/// The digits are be in base 2^32.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn from_slice(slice: &[BigDigit]) -> BigUint {
|
pub fn from_slice(slice: &[BigDigit]) -> BigUint {
|
||||||
return BigUint::new(Vec::from_slice(slice));
|
return BigUint::new(Vec::from_slice(slice));
|
||||||
|
@ -1315,12 +1319,16 @@ impl<R: Rng> RandBigInt for R {
|
||||||
|
|
||||||
impl BigInt {
|
impl BigInt {
|
||||||
/// Creates and initializes a BigInt.
|
/// Creates and initializes a BigInt.
|
||||||
|
///
|
||||||
|
/// The digits are be in base 2^32.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new(sign: Sign, v: Vec<BigDigit>) -> BigInt {
|
pub fn new(sign: Sign, v: Vec<BigDigit>) -> BigInt {
|
||||||
BigInt::from_biguint(sign, BigUint::new(v))
|
BigInt::from_biguint(sign, BigUint::new(v))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates and initializes a `BigInt`.
|
/// Creates and initializes a `BigInt`.
|
||||||
|
///
|
||||||
|
/// The digits are be in base 2^32.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn from_biguint(sign: Sign, data: BigUint) -> BigInt {
|
pub fn from_biguint(sign: Sign, data: BigUint) -> BigInt {
|
||||||
if sign == Zero || data.is_zero() {
|
if sign == Zero || data.is_zero() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue