Skip to content

Commit 5d9d652

Browse files
committed
Fix typo in dec2flt/algorithm.rs
1 parent 49c67bd commit 5d9d652

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/libcore/num/dec2flt/algorithm.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub fn fast_path<T: RawFloat>(integral: &[u8], fractional: &[u8], e: i64) -> Opt
141141
///
142142
/// It rounds ``f`` to a float with 64 bit significand and multiplies it by the best approximation
143143
/// of `10^e` (in the same floating point format). This is often enough to get the correct result.
144-
/// However, when the result is close to halfway between two adjecent (ordinary) floats, the
144+
/// However, when the result is close to halfway between two adjacent (ordinary) floats, the
145145
/// compound rounding error from multiplying two approximation means the result may be off by a
146146
/// few bits. When this happens, the iterative Algorithm R fixes things up.
147147
///
@@ -392,7 +392,7 @@ fn underflow<T: RawFloat>(x: Big, v: Big, rem: Big) -> T {
392392
//
393393
// Therefore, when the rounded-off bits are != 0.5 ULP, they decide the rounding
394394
// on their own. When they are equal and the remainder is non-zero, the value still
395-
// needs to be rounded up. Only when the rounded off bits are 1/2 and the remainer
395+
// needs to be rounded up. Only when the rounded off bits are 1/2 and the remainder
396396
// is zero, we have a half-to-even situation.
397397
let bits = x.bit_length();
398398
let lsb = bits - T::sig_bits() as usize;

0 commit comments

Comments
 (0)