pub fn unpack(packed: &[F4E2M1x2]) -> Vec<F4E2M1>Expand description
Unpacks F4E2M1x2 pairs into individual F4E2M1 values.
Each packed byte produces exactly two values. To recover the original count when the input had an odd length, the caller should truncate the result as needed.
ยงExamples
use float4::{F4E2M1, F4E2M1x2, unpack};
let packed = vec![
F4E2M1x2::new(F4E2M1::from_f64(1.0), F4E2M1::from_f64(2.0)),
];
let values = unpack(&packed);
assert_eq!(values.len(), 2);
assert_eq!(values[0].to_f64(), 1.0);
assert_eq!(values[1].to_f64(), 2.0);