about summary refs log tree commit diff
path: root/src/libcore/num/flt2dec
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-08-18 04:23:25 +0000
committerbors <bors@rust-lang.org>2015-08-18 04:23:25 +0000
commit4c0ffc0e38f1a00925935dce859262cb4e4d6f55 (patch)
tree0a6b813b76397ec1d6acba8e8d7c9a3d7514d119 /src/libcore/num/flt2dec
parentde67d62c6b7e76ca53b66b3796258238348b3c96 (diff)
parent1ddee8070d3cb83609b1f71c29e3deda3d30fd51 (diff)
Auto merge of #27823 - eefriedman:float-dep-core, r=alexcrichton
There wasn't any particular reason the functions needed to be there
anyway, so just get rid of them, and adjust libstd to compensate.

With this change, libcore depends on exactly two floating-point functions:
fmod and fmodf.  They are implicitly referenced because they are used to
implement "%".

Dependencies of libcore on Linux x86-x64 with this patch:
```
0000000000000000         *UND*	0000000000000000 __powidf2
0000000000000000         *UND*	0000000000000000 __powisf2
0000000000000000         *UND*	0000000000000000 fmod
0000000000000000         *UND*	0000000000000000 fmodf
0000000000000000         *UND*	0000000000000000 memcmp
0000000000000000         *UND*	0000000000000000 memcpy
0000000000000000         *UND*	0000000000000000 memset
0000000000000000         *UND*	0000000000000000 rust_begin_unwind
0000000000000000         *UND*	0000000000000000 rust_eh_personality
```
Diffstat (limited to 'src/libcore/num/flt2dec')
-rw-r--r--src/libcore/num/flt2dec/decoder.rs5
-rw-r--r--src/libcore/num/flt2dec/mod.rs1
-rw-r--r--src/libcore/num/flt2dec/strategy/dragon.rs1
-rw-r--r--src/libcore/num/flt2dec/strategy/grisu.rs2
4 files changed, 0 insertions, 9 deletions
diff --git a/src/libcore/num/flt2dec/decoder.rs b/src/libcore/num/flt2dec/decoder.rs
index a292ffa2e9d..6265691bde9 100644
--- a/src/libcore/num/flt2dec/decoder.rs
+++ b/src/libcore/num/flt2dec/decoder.rs
@@ -53,20 +53,15 @@ pub enum FullDecoded {
 
 /// A floating point type which can be `decode`d.
 pub trait DecodableFloat: Float + Copy {
-    /// Returns `x * 2^exp`. Almost same to `std::{f32,f64}::ldexp`.
-    /// This is used for testing.
-    fn ldexpi(f: i64, exp: isize) -> Self;
     /// The minimum positive normalized value.
     fn min_pos_norm_value() -> Self;
 }
 
 impl DecodableFloat for f32 {
-    fn ldexpi(f: i64, exp: isize) -> Self { f as Self * (exp as Self).exp2() }
     fn min_pos_norm_value() -> Self { f32::MIN_POSITIVE }
 }
 
 impl DecodableFloat for f64 {
-    fn ldexpi(f: i64, exp: isize) -> Self { f as Self * (exp as Self).exp2() }
     fn min_pos_norm_value() -> Self { f64::MIN_POSITIVE }
 }
 
diff --git a/src/libcore/num/flt2dec/mod.rs b/src/libcore/num/flt2dec/mod.rs
index 91e1d6e4e51..700523e49a2 100644
--- a/src/libcore/num/flt2dec/mod.rs
+++ b/src/libcore/num/flt2dec/mod.rs
@@ -132,7 +132,6 @@ functions.
 
 use prelude::v1::*;
 use i16;
-use num::Float;
 use slice::bytes;
 pub use self::decoder::{decode, DecodableFloat, FullDecoded, Decoded};
 
diff --git a/src/libcore/num/flt2dec/strategy/dragon.rs b/src/libcore/num/flt2dec/strategy/dragon.rs
index cdc23c45fa0..ab610f28e9e 100644
--- a/src/libcore/num/flt2dec/strategy/dragon.rs
+++ b/src/libcore/num/flt2dec/strategy/dragon.rs
@@ -17,7 +17,6 @@ Almost direct (but slightly optimized) Rust translation of Figure 3 of [1].
 
 use prelude::v1::*;
 
-use num::Float;
 use cmp::Ordering;
 
 use num::flt2dec::{Decoded, MAX_SIG_DIGITS, round_up};
diff --git a/src/libcore/num/flt2dec/strategy/grisu.rs b/src/libcore/num/flt2dec/strategy/grisu.rs
index 52eafcec184..b0822ca76c7 100644
--- a/src/libcore/num/flt2dec/strategy/grisu.rs
+++ b/src/libcore/num/flt2dec/strategy/grisu.rs
@@ -18,8 +18,6 @@ Rust adaptation of Grisu3 algorithm described in [1]. It uses about
 
 use prelude::v1::*;
 
-use num::Float;
-
 use num::flt2dec::{Decoded, MAX_SIG_DIGITS, round_up};
 
 /// A custom 64-bit floating point type, representing `f * 2^e`.