fix build error
authorJacob Lifshay <programmerjake@gmail.com>
Fri, 21 May 2021 00:40:38 +0000 (17:40 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Fri, 21 May 2021 00:40:38 +0000 (17:40 -0700)
src/algorithms/base.rs

index 255b7ebc0ee0732ecf5d73934725b896d560c5c1..b6e342604962cf666677a7454a47e450fd8f2f29 100644 (file)
@@ -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)]