pub fn encode_normal<T: RawFloat>(x: Unpacked) -> T {
    debug_assert!(T::min_sig() <= x.sig && x.sig <= T::max_sig(),
        "encode_normal: significand not normalized");
    // Remove the hidden bit
    let sig_enc = x.sig & !(1 << T::explicit_sig_bits());
    // Adjust the exponent for exponent bias and mantissa shift
    let k_enc = x.k + T::max_exp() + T::explicit_sig_bits() as i16;
    debug_assert!(k_enc != 0 && k_enc < T::max_encoded_exp(),
        "encode_normal: exponent out of range");
    // Leave sign bit at 0 ("+"), our numbers are all positive
    let bits = (k_enc as u64) << T::explicit_sig_bits() | sig_enc;
    T::from_bits(bits)
}
/// Inverse of `RawFloat::unpack()` for normalized numbers.
/// Panics if the significand or exponent are not valid for normalized numbers.
Inverse of `RawFloat::unpack()` for normalized numbers.
Panics if the significand or exponent are not valid for normalized numbers.
Inverse of ` RawFloat :: unpack () ` for normalized numbers . Panics if the significand or exponent are not valid for normalized numbers .
pub fn encode_normal<T: RawFloat>(x: Unpacked) -> T {
    debug_assert!(T::min_sig() <= x.sig && x.sig <= T::max_sig(),
        "encode_normal: significand not normalized");
    // Remove the hidden bit
    let sig_enc = x.sig & !(1 << T::explicit_sig_bits());
    // Adjust the exponent for exponent bias and mantissa shift
    let k_enc = x.k + T::max_exp() + T::explicit_sig_bits() as i16;
    debug_assert!(k_enc != 0 && k_enc < T::max_encoded_exp(),
        "encode_normal: exponent out of range");
    // Leave sign bit at 0 ("+"), our numbers are all positive
    let bits = (k_enc as u64) << T::explicit_sig_bits() | sig_enc;
    T::from_bits(bits)
}
pub fn encode_normal < T : RawFloat > ( x : Unpacked ) -> T { debug_assert ! ( T min_sig ( ) x sig x sig T max_sig ( ) " " ) ; // Remove the hidden bit let sig_enc = x . sig & ! ( 1 << T :: explicit_sig_bits ( ) ) ; // Adjust the exponent for exponent bias and mantissa shift let k_enc = x . k + T :: max_exp ( ) + T :: explicit_sig_bits ( ) as i16 ; debug_assert ! ( k_enc 0 k_enc T max_encoded_exp ( ) " " ) ; // Leave sign bit at 0 ("+"), our numbers are all positive let bits = ( k_enc as u64 ) << T :: explicit_sig_bits ( ) | sig_enc ; T :: from_bits ( bits ) }
Inverse of `RawFloat::unpack()` for normalized numbers.
Inverse of ` RawFloat :: unpack () ` for normalized numbers .
x
Unpacked
x
Unpacked