pub fn concat(&self, other: &Self) -> Result<Self, SynthesisError> {
        let limb_width = self.enforce_limb_width_agreement(other, "concat")?;
        let min_bits = if self.params.min_bits > 0 {
            self.params.min_bits + other.params.limb_width * other.params.n_limbs
        } else {
            other.params.min_bits
        };
        let mut limbs = other.limbs.clone();
        limbs.extend(self.limbs.iter().cloned());
        let mut limb_values = other.limb_values.clone();
        limb_values.as_mut().map(|x| {
            self.limb_values
                .as_ref()
                .map(|y| x.extend(y.iter().cloned()))
        });
        let value = self.value.clone().and_then(|sv| {
            other
                .value
                .as_ref()
                .map(|ov| (sv << (other.params.limb_width * other.params.n_limbs) as u32) + ov)
        });
        Ok(Self {
            params: BigNatParams {
                min_bits,
                max_word: max(&self.params.max_word, &other.params.max_word).clone(),
                n_limbs: self.params.n_limbs + other.params.n_limbs,
                limb_width,
            },
            limb_values,
            limbs,
            value,
        })
    }
/// Concatenate two numbers. `self` becomes the high-order part.
Concatenate two numbers. `self` becomes the high-order part.
Concatenate two numbers . ` self ` becomes the high - order part .
pub fn concat(&self, other: &Self) -> Result<Self, SynthesisError> {
        let limb_width = self.enforce_limb_width_agreement(other, "concat")?;
        let min_bits = if self.params.min_bits > 0 {
            self.params.min_bits + other.params.limb_width * other.params.n_limbs
        } else {
            other.params.min_bits
        };
        let mut limbs = other.limbs.clone();
        limbs.extend(self.limbs.iter().cloned());
        let mut limb_values = other.limb_values.clone();
        limb_values.as_mut().map(|x| {
            self.limb_values
                .as_ref()
                .map(|y| x.extend(y.iter().cloned()))
        });
        let value = self.value.clone().and_then(|sv| {
            other
                .value
                .as_ref()
                .map(|ov| (sv << (other.params.limb_width * other.params.n_limbs) as u32) + ov)
        });
        Ok(Self {
            params: BigNatParams {
                min_bits,
                max_word: max(&self.params.max_word, &other.params.max_word).clone(),
                n_limbs: self.params.n_limbs + other.params.n_limbs,
                limb_width,
            },
            limb_values,
            limbs,
            value,
        })
    }
pub fn concat ( & self , other : & Self ) -> Result < Self , SynthesisError > { let limb_width = self . enforce_limb_width_agreement ( other , " " ) ? ; let min_bits = if self . params . min_bits > 0 { self . params . min_bits + other . params . limb_width * other . params . n_limbs } else { other . params . min_bits } ; let mut limbs = other . limbs . clone ( ) ; limbs . extend ( self . limbs . iter ( ) . cloned ( ) ) ; let mut limb_values = other . limb_values . clone ( ) ; limb_values . as_mut ( ) . map ( | x | { self . limb_values . as_ref ( ) . map ( | y | x . extend ( y . iter ( ) . cloned ( ) ) ) } ) ; let value = self . value . clone ( ) . and_then ( | sv | { other . value . as_ref ( ) . map ( | ov | ( sv << ( other . params . limb_width * other . params . n_limbs ) as u32 ) + ov ) } ) ; Ok ( Self { params : BigNatParams { min_bits , max_word : max ( & self . params . max_word , & other . params . max_word ) . clone ( ) , n_limbs : self . params . n_limbs + other . params . n_limbs , limb_width , } , limb_values , limbs , value , } ) }
Concatenate two numbers.
Concatenate two numbers .
&self
other
&Self
&self
other
&Self