From 0ea2f5463730a0067f4c146dd7f33398fcac8229 Mon Sep 17 00:00:00 2001 From: inmarket Date: Thu, 24 Oct 2013 15:25:50 +1000 Subject: [PATCH] Slight improvement to the precision of the GMISC invsqrt() function. --- src/gmisc/trig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gmisc/trig.c b/src/gmisc/trig.c index cd35bdc0..2485da85 100644 --- a/src/gmisc/trig.c +++ b/src/gmisc/trig.c @@ -167,7 +167,7 @@ #endif // evil floating point bit level hacking - i = 0x5F3759DF - (i >> 1); + i = 0x5F375A86 - (i >> 1); // The quake code used 0x5F3759DF but this is better. // Convert back to a float (no binary format conversion) #if GDISP_INVSQRT_MIXED_ENDIAN