4 ms·
Low-level machine hacks can be inscrutable even when the machine they're implemented for is current. For instance, there's the infamous line from Quake source c
by henning 18y ago
Low-level machine hacks can be inscrutable even when the machine they're implemented for is current. For instance, there's the infamous line from Quake source code that reads:
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
People have tried to investigate the origin of this baffling hack and mostly failed. See, e.g., http://www.beyond3d.com/content/articles/8/ http://www.beyond3d.com/content/articles/8/ .
- jmagar 18y agoThat's one heck of a magic number... The strangest one I've seen is the fast sqrt() function in SGI OpenGL source code: there's a magic step where a right bit shift is applied to a 32bit IEEE float. (oops.. just clicked your link, looks like we're related)