pub fn round_normal<T: RawFloat>(x: Fp) -> Unpacked {
    let excess = 64 - T::sig_bits() as i16;
    let half: u64 = 1 << (excess - 1);
    let (q, rem) = (x.f >> excess, x.f & ((1 << excess) - 1));
    assert_eq!(q << excess | rem, x.f);
    // Adjust mantissa shift
    let k = x.e + excess;
    if rem < half {
        Unpacked::new(q, k)
    } else if rem == half && (q % 2) == 0 {
        Unpacked::new(q, k)
    } else if q == T::max_sig() {
        Unpacked::new(T::min_sig(), k + 1)
    } else {
        Unpacked::new(q + 1, k)
    }
}
/// Round the 64-bit significand to 53 bit with half-to-even. Does not handle exponent overflow.
Round the 64-bit significand to 53 bit with half-to-even. Does not handle exponent overflow.
Round the 64 - bit significand to 53 bit with half - to - even . Does not handle exponent overflow .
pub fn round_normal<T: RawFloat>(x: Fp) -> Unpacked {
    let excess = 64 - T::sig_bits() as i16;
    let half: u64 = 1 << (excess - 1);
    let (q, rem) = (x.f >> excess, x.f & ((1 << excess) - 1));
    assert_eq!(q << excess | rem, x.f);
    // Adjust mantissa shift
    let k = x.e + excess;
    if rem < half {
        Unpacked::new(q, k)
    } else if rem == half && (q % 2) == 0 {
        Unpacked::new(q, k)
    } else if q == T::max_sig() {
        Unpacked::new(T::min_sig(), k + 1)
    } else {
        Unpacked::new(q + 1, k)
    }
}
pub fn round_normal < T : RawFloat > ( x : Fp ) -> Unpacked { let excess = 64 - T :: sig_bits ( ) as i16 ; let half : u64 = 1 << ( excess - 1 ) ; let ( q , rem ) = ( x . f >> excess , x . f & ( ( 1 << excess ) - 1 ) ) ; assert_eq ! ( q excess rem x f ) ; // Adjust mantissa shift let k = x . e + excess ; if rem < half { Unpacked :: new ( q , k ) } else if rem == half && ( q % 2 ) == 0 { Unpacked :: new ( q , k ) } else if q == T :: max_sig ( ) { Unpacked :: new ( T :: min_sig ( ) , k + 1 ) } else { Unpacked :: new ( q + 1 , k ) } }
Round the 64-bit significand to 53 bit with half-to-even.
Round the 64 - bit significand to 53 bit with half - to - even .
x
Fp
x
Fp