I know this has been looked at before a lot, but I was wondering what a line in this q3 code does. This code is very confusing partly because of that crazy number they invent.
What exactly does casting the address of a float do?Code:float Q_rsqrt( float number )
{
long i;
float x2, y;
y = number;
i = * ( long * ) &y; //what does this do?
i = 0x5f3759df - ( i >> 1 );
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
return y;
}
