Skip to content

Commit b55806c

Browse files
author
Robin Kruppe
committed
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.
1 parent e5d90d9 commit b55806c

File tree

1 file changed

+3
-3
lines changed
  • src/libcore/num/flt2dec/strategy

1 file changed

+3
-3
lines changed

src/libcore/num/flt2dec/strategy/grisu.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub struct Fp {
3434

3535
impl Fp {
3636
/// Returns a correctly rounded product of itself and `other`.
37-
fn mul(&self, other: &Fp) -> Fp {
37+
pub fn mul(&self, other: &Fp) -> Fp {
3838
const MASK: u64 = 0xffffffff;
3939
let a = self.f >> 32;
4040
let b = self.f & MASK;
@@ -51,7 +51,7 @@ impl Fp {
5151
}
5252

5353
/// Normalizes itself so that the resulting mantissa is at least `2^63`.
54-
fn normalize(&self) -> Fp {
54+
pub fn normalize(&self) -> Fp {
5555
let mut f = self.f;
5656
let mut e = self.e;
5757
if f >> (64 - 32) == 0 { f <<= 32; e -= 32; }
@@ -66,7 +66,7 @@ impl Fp {
6666

6767
/// Normalizes itself to have the shared exponent.
6868
/// It can only decrease the exponent (and thus increase the mantissa).
69-
fn normalize_to(&self, e: i16) -> Fp {
69+
pub fn normalize_to(&self, e: i16) -> Fp {
7070
let edelta = self.e - e;
7171
assert!(edelta >= 0);
7272
let edelta = edelta as usize;

0 commit comments

Comments
 (0)