That's what I meant.wiki wrote: Unique values with unexplained meaning or multiple occurrences which could (preferably) be replaced with named constants
Anyway, the magic number mentioned in the comic (0x5f375a86) refers to this: http://en.wikipedia.org/wiki/Fast_inverse_square_root
tl;dr version:
Computers can't do square root very fast. In fact it can be hundreds of times slower than addition/subtraction/multiplication.
Computer games need a shitload of square root calculations for physics simulation, and they need them FAST. Approximate methods are usually used.
At some point, years after the game was published, someone made public the inverse square root calculation method in Quake III Arena. The interesting bit is this: (also it has the original comments)
Code: Select all
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the f*ck?
y = * ( float * ) &i;
However this method turns out to have been faster than any other method known at the time(maybe it still is, I dunno). Also no one knows exactly where the code originates. Judging from the comments it's pretty clear the Quake guys didn't write it themselves.
tl;dr tl;dr
0x5f3759df is magic yo. Aliens probably did it.

















