Reorganize core::num internals

Move private bignum module to core::num, because it is not only used in flt2dec.
Extract private 80-bit soft-float into new core::num module for the same reason.
This commit is contained in:
Robin Kruppe 2015-09-20 18:34:33 +02:00
parent cff0411706
commit cd67ec306f
16 changed files with 106 additions and 79 deletions

View file

@ -9,7 +9,7 @@
// except according to those terms.
use std::prelude::v1::*;
use core::num::flt2dec::bignum::tests::Big8x3 as Big;
use core::num::bignum::tests::Big8x3 as Big;
#[test]
#[should_panic]

View file

@ -9,14 +9,14 @@
// except according to those terms.
use std::f64;
use core::num::flt2dec::strategy::grisu::Fp;
use core::num::diy_float::Fp;
use core::num::dec2flt::rawfp::{fp_to_float, prev_float, next_float, round_normal};
#[test]
fn fp_to_float_half_to_even() {
fn is_normalized(sig: u64) -> bool {
// intentionally written without {min,max}_sig() as a sanity check
sig >> 52 == 1 && sig >> 53 == 0
// intentionally written without {min,max}_sig() as a sanity check
sig >> 52 == 1 && sig >> 53 == 0
}
fn conv(sig: u64) -> u64 {

View file

@ -23,7 +23,6 @@ use core::num::flt2dec::{to_shortest_str, to_shortest_exp_str,
pub use test::Bencher;
mod estimator;
mod bignum;
mod strategy {
mod dragon;
mod grisu;

View file

@ -12,7 +12,7 @@ use std::prelude::v1::*;
use std::{i16, f64};
use super::super::*;
use core::num::flt2dec::*;
use core::num::flt2dec::bignum::Big32x40 as Big;
use core::num::bignum::Big32x40 as Big;
use core::num::flt2dec::strategy::dragon::*;
#[test]

View file

@ -31,6 +31,7 @@ mod u64;
mod flt2dec;
mod dec2flt;
mod bignum;
/// Helper function for testing numeric operations
pub fn test_num<T>(ten: T, two: T) where