use super::Exception;
use crate::{bitpack::bitpack_encoded, float::AlpFloat, header::write_header, params::pack_params};
#[inline(always)]
#[allow(clippy::too_many_arguments)]
pub fn encode_standard<F: AlpFloat>(
count: usize,
exp: u8,
fac: u8,
use_div: bool,
encoded_ints: &[F::Int],
base: F::Int,
bit_width: u8,
exceptions: &[Exception<F::RawBits>],
dst: &mut Vec<u8>,
) {
let type_byte = if use_div {
F::TYPE_DEC_BYTE
} else {
F::TYPE_BYTE
};
let packed_params = pack_params(exp, fac, bit_width);
write_header(type_byte, count, Some(packed_params), dst);
F::write_base(base, dst);
bitpack_encoded::<F>(encoded_ints, base, bit_width, dst);
super::write_exceptions::<F>(count, exceptions, dst);
}