summaryrefslogtreecommitdiff
path: root/src/math/math.c
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-12-05 09:21:26 +0800
committerchai <chaifix@163.com>2019-12-05 09:21:26 +0800
commit8e684dc0c76708e3174f005aebcaabc144b85500 (patch)
treed7803e49ee1fdb5575128114d19499787f870c00 /src/math/math.c
parent2e82e2ddd0852b8063a3d6645366f53ee844e273 (diff)
*背面剔除
Diffstat (limited to 'src/math/math.c')
-rw-r--r--src/math/math.c3
1 files changed, 1 insertions, 2 deletions
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;
}