From: Jacob Lifshay Date: Fri, 21 May 2021 00:40:38 +0000 (-0700) Subject: fix build error X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fc130c84735dc6f326bf562392a4ccc956664ebe;p=vector-math.git fix build error --- diff --git a/src/algorithms/base.rs b/src/algorithms/base.rs index 255b7eb..b6e3426 100644 --- a/src/algorithms/base.rs +++ b/src/algorithms/base.rs @@ -147,7 +147,7 @@ pub fn sqrt_rsqrt_kernel< v: VecF, iteration_count: usize, ) -> (VecF, VecF) { - /// based on second algorithm of https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Goldschmidt%E2%80%99s_algorithm + // based on second algorithm of https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Goldschmidt%E2%80%99s_algorithm let y = initial_rsqrt_approximation(ctx, v); let mut x = v * y; let one_half: VecF = ctx.make(0.5.to()); @@ -157,7 +157,7 @@ pub fn sqrt_rsqrt_kernel< x = x.mul_add_fast(r, x); neg_h = neg_h.mul_add_fast(r, neg_h); } - (x, neg_h * ctx.make(-2.to())) + (x, neg_h * ctx.make(PrimF::cvt_from(-2))) } #[cfg(test)]