// Range of decimal exponents [K_min, K_max] from the paper. let dec_exp_min = -324_i32; let dec_exp_max = 292_i32;
let num_bits = 128_i32;
// Negate dec_pow_min and dec_pow_max because we need negative powers 10^-k. for (i, dec_exp) in (-dec_exp_max..=-dec_exp_min).enumerate() { // dec_exp is -k in the paper. let bin_exp = (f64::from(dec_exp) * LOG2_10).floor() as i32 - (num_bits - 1); let bin_pow = Uint::from(2_u8).pow(bin_exp.unsigned_abs()); let dec_pow = Uint::from(10_u8).pow(dec_exp.unsigned_abs()); let result = if dec_exp < 0 {
bin_pow / dec_pow
} elseif bin_exp < 0 {
dec_pow * bin_pow
} else {
dec_pow / bin_pow
}; let hi = u64::try_from(&result >> 64).unwrap(); let lo = u64::try_from(result & (Uint::from(2_u8).pow(64) - Uint::from(1_u8))).unwrap(); if !crate::Pow10SignificandsTable::COMPRESS {
assert_eq!( crate::POW10_SIGNIFICANDS.get(DEC_EXP_MIN + i as i32), crate::uint128 { hi, lo },
);
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.