From fc130c84735dc6f326bf562392a4ccc956664ebe Mon Sep 17 00:00:00 2001 From: Jacob Lifshay Date: Thu, 20 May 2021 17:40:38 -0700 Subject: [PATCH] fix build error --- src/algorithms/base.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)] -- 2.30.2