use crate::decimal::dec::convert::to_float::float::common::common_float_impl;
common_float_impl!(f64);
pub const MIN_10_EXP_REAL: i32 = -342;
pub const MIN_EXPONENT_ROUND_TO_EVEN: i32 = -4;
pub const MAX_EXPONENT_ROUND_TO_EVEN: i32 = 23;
#[inline(always)]
pub const fn pow10_fast_path(exponent: usize) -> f64 {
const TABLE: [f64; 32] = [
1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16,
1e17, 1e18, 1e19, 1e20, 1e21, 1e22, 0., 0., 0., 0., 0., 0., 0., 0., 0.,
];
TABLE[exponent & 31]
}
#[inline(always)]
pub const fn float(mut mantissa: u64, biased_exp: i32) -> f64 {
mantissa &= MAN_MASK;
mantissa |= (biased_exp as u64) << (MANTISSA_DIGITS - 1);
f64::from_bits(mantissa)
}