diff --git a/vlib/math/q_rsqrt.v b/vlib/math/q_rsqrt.v index 47b4864d35..ad750d0058 100644 --- a/vlib/math/q_rsqrt.v +++ b/vlib/math/q_rsqrt.v @@ -1,5 +1,11 @@ module math +// q_sqrt computes an approximation of the inverse square root (1 / √x) using a fast +// inverse square root algorithm. This method is often used in applications +// where performance is crucial, such as in computer graphics or physics +// simulations. +// (This algorithm is inspired by the famous "fast inverse square root" code +// used in the Quake III Arena game engine.) @[inline] pub fn q_rsqrt(x f64) f64 { x_half := 0.5 * x