Use fully-qualified syntax for abs_diff to avoid warning, which can trigger a compiler error.

This commit is contained in:
William D. Jones
2021-11-27 19:38:43 -05:00
parent e6d7983889
commit f275e26e3d

View File

@@ -5,7 +5,7 @@ use int::Int;
fn pow<F: Float>(a: F, b: i32) -> F {
let mut a = a;
let recip = b < 0;
let mut pow = i32::abs_diff(b, 0);
let mut pow = Int::abs_diff(b, 0);
let mut mul = F::ONE;
loop {
if (pow & 1) != 0 {