diff options
| author | Robin Kruppe <robin.kruppe@gmail.com> | 2015-06-27 21:59:31 +0200 |
|---|---|---|
| committer | Robin Kruppe <robin.kruppe@gmail.com> | 2015-08-08 17:12:29 +0200 |
| commit | b55806ca8ff97ee89f77f9c784619ace3034c32c (patch) | |
| tree | c5f2dd3addb5fdcfd1e38e95485e8c3547b0115c /src/libcore/num | |
| parent | e5d90d98402475b6e154ce216f9efcb80da1a747 (diff) | |
| download | rust-b55806ca8ff97ee89f77f9c784619ace3034c32c.tar.gz rust-b55806ca8ff97ee89f77f9c784619ace3034c32c.zip | |
Make core::num::dec2flt::strategy::grisu::Fp methods public.
The intent is to allow decimal-to-float parsing to use Fp in its fast path. That code is added in a later commit.
Diffstat (limited to 'src/libcore/num')
| -rw-r--r-- | src/libcore/num/flt2dec/strategy/grisu.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/num/flt2dec/strategy/grisu.rs b/src/libcore/num/flt2dec/strategy/grisu.rs index 390920a354c..52eafcec184 100644 --- a/src/libcore/num/flt2dec/strategy/grisu.rs +++ b/src/libcore/num/flt2dec/strategy/grisu.rs @@ -34,7 +34,7 @@ pub struct Fp { impl Fp { /// Returns a correctly rounded product of itself and `other`. - fn mul(&self, other: &Fp) -> Fp { + pub fn mul(&self, other: &Fp) -> Fp { const MASK: u64 = 0xffffffff; let a = self.f >> 32; let b = self.f & MASK; @@ -51,7 +51,7 @@ impl Fp { } /// Normalizes itself so that the resulting mantissa is at least `2^63`. - fn normalize(&self) -> Fp { + pub fn normalize(&self) -> Fp { let mut f = self.f; let mut e = self.e; if f >> (64 - 32) == 0 { f <<= 32; e -= 32; } @@ -66,7 +66,7 @@ impl Fp { /// Normalizes itself to have the shared exponent. /// It can only decrease the exponent (and thus increase the mantissa). - fn normalize_to(&self, e: i16) -> Fp { + pub fn normalize_to(&self, e: i16) -> Fp { let edelta = self.e - e; assert!(edelta >= 0); let edelta = edelta as usize; |
