From 8e684dc0c76708e3174f005aebcaabc144b85500 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 5 Dec 2019 09:21:26 +0800 Subject: =?UTF-8?q?*=E8=83=8C=E9=9D=A2=E5=89=94=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/math/math.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/math/math.c') diff --git a/src/math/math.c b/src/math/math.c index 4cca29e..7d731f8 100644 --- a/src/math/math.c +++ b/src/math/math.c @@ -5,14 +5,13 @@ char printbuffer[2048] = { 0 }; float rsqrt(float number) { long i; float x2, y; - const float threehalfs = 1.5F; x2 = number * 0.5F; y = number; i = *(long *)&y; i = 0x5f3759df - (i >> 1); y = *(float *)&i; - y = y * (threehalfs - (x2 * y * y)); + y = y * (1.5F - (x2 * y * y)); return y; } -- cgit v1.1-26-g67d0