Skip to content

Instantly share code, notes, and snippets.

View cesarkawakamiee's full-sized avatar

Cesar Kawakami cesarkawakamiee

  • Geekie
  • São Paulo, Brazil
View GitHub Profile
// this computes 1 / sqrt(number)
float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking