/// Creates a new Value of a given bitwidth out of an initial_val. It's
/// safer to use [from] followed by [unwrap].
///
/// # Example:
/// ```
/// use interp::values::*;
/// let val_16_16 = Value::from_init(16 as u64, 16 as usize);
/// ```
Creates a new Value of a given bitwidth out of an initial_val. It's
safer to use [from] followed by [unwrap].
Creates a new Value of a given bitwidth out of an initial_val . It ' s safer to use [ from ] followed by [ unwrap ] .
pub fn from_init<T1: Into<u64>, T2: Into<usize>>(
        initial_val: T1,
        bitwidth: T2,
    ) -> Self {
        let mut vec = BitVec::from_element(initial_val.into());
        vec.resize(bitwidth.into(), false);
        Value { vec }
    }
pub fn from_init < T1 : Into < u64 > , T2 : Into < usize > > ( initial_val : T1 , bitwidth : T2 , ) -> Self { let mut vec = BitVec :: from_element ( initial_val . into ( ) ) ; vec . resize ( bitwidth . into ( ) , false ) ; Value { vec } }
Creates a new Value of a given bitwidth out of an initial_val.
Creates a new Value of a given bitwidth out of an initial_val .
initial_val
T1
bitwidth
T2
example:
None