Format with rustfmt 0.9.0

This commit is contained in:
David Tolnay
2018-08-04 21:40:48 -07:00
parent 849228e22d
commit 78ef45f901
2 changed files with 17 additions and 6 deletions
+12 -4
View File
@@ -225,9 +225,13 @@ pub fn d2d(ieee_mantissa: u64, ieee_exponent: u32) -> FloatingDecimal64 {
vr = mul_shift_all(
m2,
#[cfg(feature = "small")]
unsafe { &compute_inv_pow5(q) },
unsafe {
&compute_inv_pow5(q)
},
#[cfg(not(feature = "small"))]
unsafe { DOUBLE_POW5_INV_SPLIT.get_unchecked(q as usize) },
unsafe {
DOUBLE_POW5_INV_SPLIT.get_unchecked(q as usize)
},
i as u32,
&mut vp,
&mut vm,
@@ -257,9 +261,13 @@ pub fn d2d(ieee_mantissa: u64, ieee_exponent: u32) -> FloatingDecimal64 {
vr = mul_shift_all(
m2,
#[cfg(feature = "small")]
unsafe { &compute_pow5(i as u32) },
unsafe {
&compute_pow5(i as u32)
},
#[cfg(not(feature = "small"))]
unsafe { DOUBLE_POW5_SPLIT.get_unchecked(i as usize) },
unsafe {
DOUBLE_POW5_SPLIT.get_unchecked(i as usize)
},
j as u32,
&mut vp,
&mut vm,
+5 -2
View File
@@ -168,7 +168,8 @@ pub unsafe fn compute_pow5(i: u32) -> (u64, u64) {
let delta = pow5bits(i as i32) - pow5bits(base2 as i32);
debug_assert!(base < POW5_OFFSETS.len() as u32);
(
shiftright128(low0, sum, delta) + ((*POW5_OFFSETS.get_unchecked(base as usize) >> offset) & 1) as u64,
shiftright128(low0, sum, delta)
+ ((*POW5_OFFSETS.get_unchecked(base as usize) >> offset) & 1) as u64,
shiftright128(sum, high1, delta),
)
}
@@ -197,7 +198,9 @@ pub unsafe fn compute_inv_pow5(i: u32) -> (u64, u64) {
let delta = pow5bits(base2 as i32) - pow5bits(i as i32);
debug_assert!(base < POW5_INV_OFFSETS.len() as u32);
(
shiftright128(low0, sum, delta) + 1 + ((*POW5_INV_OFFSETS.get_unchecked((i / 16) as usize) >> ((i % 16) << 1)) & 3) as u64,
shiftright128(low0, sum, delta)
+ 1
+ ((*POW5_INV_OFFSETS.get_unchecked((i / 16) as usize) >> ((i % 16) << 1)) & 3) as u64,
shiftright128(sum, high1, delta),
)
}