diff options
| author | bors <bors@rust-lang.org> | 2017-03-26 14:04:25 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-03-26 14:04:25 +0000 |
| commit | 7846dbe0c8de17f59cdfc3d2b914d58faad7eade (patch) | |
| tree | 87a4a8f5945327ad7b3c9700160dcdfa83133245 /src/libcore | |
| parent | bcfd5c48b7ec96cc28bef2cc5e29b4ae0ce6c3ac (diff) | |
| parent | dc52625d61e11f5cbdde5debdcf9b1e1fc48324f (diff) | |
| download | rust-7846dbe0c8de17f59cdfc3d2b914d58faad7eade.tar.gz rust-7846dbe0c8de17f59cdfc3d2b914d58faad7eade.zip | |
Auto merge of #40826 - frewsxcv:rollup, r=frewsxcv
Rollup of 7 pull requests - Successful merges: #40642, #40734, #40740, #40771, #40807, #40820, #40821 - Failed merges:
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/num/dec2flt/algorithm.rs | 4 | ||||
| -rw-r--r-- | src/libcore/slice/sort.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/num/dec2flt/algorithm.rs b/src/libcore/num/dec2flt/algorithm.rs index 604bc7c10de..60dab943a3a 100644 --- a/src/libcore/num/dec2flt/algorithm.rs +++ b/src/libcore/num/dec2flt/algorithm.rs @@ -141,7 +141,7 @@ pub fn fast_path<T: RawFloat>(integral: &[u8], fractional: &[u8], e: i64) -> Opt /// /// It rounds ``f`` to a float with 64 bit significand and multiplies it by the best approximation /// of `10^e` (in the same floating point format). This is often enough to get the correct result. -/// However, when the result is close to halfway between two adjecent (ordinary) floats, the +/// However, when the result is close to halfway between two adjacent (ordinary) floats, the /// compound rounding error from multiplying two approximation means the result may be off by a /// few bits. When this happens, the iterative Algorithm R fixes things up. /// @@ -392,7 +392,7 @@ fn underflow<T: RawFloat>(x: Big, v: Big, rem: Big) -> T { // // Therefore, when the rounded-off bits are != 0.5 ULP, they decide the rounding // on their own. When they are equal and the remainder is non-zero, the value still - // needs to be rounded up. Only when the rounded off bits are 1/2 and the remainer + // needs to be rounded up. Only when the rounded off bits are 1/2 and the remainder // is zero, we have a half-to-even situation. let bits = x.bit_length(); let lsb = bits - T::sig_bits() as usize; diff --git a/src/libcore/slice/sort.rs b/src/libcore/slice/sort.rs index d13d537d993..307e4974d97 100644 --- a/src/libcore/slice/sort.rs +++ b/src/libcore/slice/sort.rs @@ -152,8 +152,8 @@ fn partial_insertion_sort<T, F>(v: &mut [T], is_less: &mut F) -> bool fn insertion_sort<T, F>(v: &mut [T], is_less: &mut F) where F: FnMut(&T, &T) -> bool { - for i in 2..v.len()+1 { - shift_tail(&mut v[..i], is_less); + for i in 1..v.len() { + shift_tail(&mut v[..i+1], is_less); } } |
