On Sat, May 29, 2010 at 3:52 PM, Thilo Schulz <a...@ats.s.bawue.de> wrote: > This "hack" is actually an approximation of the inverse square root function, > by means of the Newton-Raphson-iteration which is broken off after the first > iteration. The trick lies in choosing a good initial value for that iteration. > I haven't understood it myself either why it works, but choosing of initial > value seems to be done with this line: > > t.i = 0x5f3759df - ( t.i >> 1 ); // what the fuck? > > This code apparently works for all float numbers (except for the negative ones > of course that cannot be computed) to good accuracy. There's a paper written > about this here: > > http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf
That still doesn't answer the question, I guess it's a response to the guy that didn't know what it was. I mean, if the approximation has any sideeffects on the end-game. _______________________________________________ ioquake3 mailing list ioquake3@lists.ioquake.org http://lists.ioquake.org/listinfo.cgi/ioquake3-ioquake.org By sending this message I agree to love ioquake3 and libsdl.