diff options
| author | Robin Kruppe <robin.kruppe@gmail.com> | 2016-01-26 22:08:01 +0100 |
|---|---|---|
| committer | Robin Kruppe <robin.kruppe@gmail.com> | 2016-02-04 16:24:23 +0100 |
| commit | 25c9ac32804ff3d513020f02a8bbe5bc1afd6504 (patch) | |
| tree | ebfec287af410a36980d220aec22b9a004e45207 /src | |
| parent | 13b5edab6323b676cae21df54bb58a5dc1339f38 (diff) | |
| download | rust-25c9ac32804ff3d513020f02a8bbe5bc1afd6504.tar.gz rust-25c9ac32804ff3d513020f02a8bbe5bc1afd6504.zip | |
Use the right target ratio in Algorithm M quickstart.
Using f64's bit size probably wasn't actually *wrong*, but it would overshoot for no reason. This might have slowed down f32 parsing significantly.
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/num/dec2flt/algorithm.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcore/num/dec2flt/algorithm.rs b/src/libcore/num/dec2flt/algorithm.rs index 82d3389edc4..245f415de00 100644 --- a/src/libcore/num/dec2flt/algorithm.rs +++ b/src/libcore/num/dec2flt/algorithm.rs @@ -278,7 +278,7 @@ fn quick_start<T: RawFloat>(u: &mut Big, v: &mut Big, k: &mut i16) { // The target ratio is one where u/v is in an in-range significand. Thus our termination // condition is log2(u / v) being the significand bits, plus/minus one. // FIXME Looking at the second bit could improve the estimate and avoid some more divisions. - let target_ratio = f64::sig_bits() as i16; + let target_ratio = T::sig_bits() as i16; let log2_u = u.bit_length() as i16; let log2_v = v.bit_length() as i16; let mut u_shift: i16 = 0; |
