Fix type inference failure on some targets

This commit is contained in:
Vinzent Steinberg 2018-07-27 15:14:44 +02:00
parent 365c127e35
commit 537a00c053

View File

@ -243,15 +243,16 @@ macro_rules! define_moments {
let mut coeff_a = 1.; let mut coeff_a = 1.;
let mut coeff_b = 1.; let mut coeff_b = 1.;
let mut coeff_delta = 1.; let mut coeff_delta = 1.;
let mut binom = IterBinomial::new(p); let mut binom = IterBinomial::new(p as u64);
binom.next().unwrap(); binom.next().unwrap();
for k in 1..(p - 1) { for k in 1..(p - 1) {
coeff_a *= -n_b_over_n; coeff_a *= -n_b_over_n;
coeff_b *= n_a_over_n; coeff_b *= n_a_over_n;
coeff_delta *= delta; coeff_delta *= delta;
self.m[p - 2] += f64::approx_from(binom.next().unwrap()).unwrap() * self.m[p - 2] +=
coeff_delta * f64::approx_from(binom.next().unwrap()).unwrap() *
(prev_m[p - 2 - k] * coeff_a + other.m[p - 2 - k] * coeff_b); coeff_delta * (prev_m[p - 2 - k] * coeff_a +
other.m[p - 2 - k] * coeff_b);
} }
} }
} }