fn shift_adjust(&self, mut pivot: Vec<bool>) -> Result<String, BibiError> {
        let radix = self.numsys_out.len() as u32;

        let len_bits = pivot.len();
        let mut bcdlike: Vec<u32> = vec![0];

        for _ in 0..len_bits {
            // shift
            let bit = pivot.remove(0);
            let mut rel = if bit { 1 } else { 0 };

            // adjust
            for idx in 0..bcdlike.len() {
                let mut val = (bcdlike[idx] * 2) + rel;
                rel = 0;
                if val >= radix {
                    val = val - radix;
                    rel = 1;
                }
                bcdlike[idx] = val;
            }
            if rel == 1 {
                bcdlike.push(rel);
            }
        }

        let mut ret = self.numsys_out.prefix.clone();
        for idx in (0..bcdlike.len()).rev() {
            let val = bcdlike[idx];
            ret = ret + self.numsys_out.revdigits.get(&val).unwrap();
        }

        Ok(ret)
    }
// compute  binary numbers into BCD like
compute  binary numbers into BCD like
compute binary numbers into BCD like
fn shift_adjust(&self, mut pivot: Vec<bool>) -> Result<String, BibiError> {
        let radix = self.numsys_out.len() as u32;
        let len_bits = pivot.len();
        let mut bcdlike: Vec<u32> = vec![0];
        for _ in 0..len_bits {
            // shift
            let bit = pivot.remove(0);
            let mut rel = if bit { 1 } else { 0 };
            // adjust
            for idx in 0..bcdlike.len() {
                let mut val = (bcdlike[idx] * 2) + rel;
                rel = 0;
                if val >= radix {
                    val = val - radix;
                    rel = 1;
                }
                bcdlike[idx] = val;
            }
            if rel == 1 {
                bcdlike.push(rel);
            }
        }
        let mut ret = self.numsys_out.prefix.clone();
        for idx in (0..bcdlike.len()).rev() {
            let val = bcdlike[idx];
            ret = ret + self.numsys_out.revdigits.get(&val).unwrap();
        }
        Ok(ret)
    }
fn shift_adjust ( & self , mut pivot : Vec < bool > ) -> Result < String , BibiError > { let radix = self . numsys_out . len ( ) as u32 ; let len_bits = pivot . len ( ) ; let mut bcdlike : Vec < u32 > = vec ! [ 0 ] ; for _ in 0 .. len_bits { // shift let bit = pivot . remove ( 0 ) ; let mut rel = if bit { 1 } else { 0 } ; // adjust for idx in 0 .. bcdlike . len ( ) { let mut val = ( bcdlike [ idx ] * 2 ) + rel ; rel = 0 ; if val >= radix { val = val - radix ; rel = 1 ; } bcdlike [ idx ] = val ; } if rel == 1 { bcdlike . push ( rel ) ; } } let mut ret = self . numsys_out . prefix . clone ( ) ; for idx in ( 0 .. bcdlike . len ( ) ) . rev ( ) { let val = bcdlike [ idx ] ; ret = ret + self . numsys_out . revdigits . get ( & val ) . unwrap ( ) ; } Ok ( ret ) }
compute  binary numbers into BCD like
compute binary numbers into BCD like
&self
pivot
Vec<bool>
&self
pivot
Vec<bool>