标签:oat const volatil ons lan ret cpp code float
雷神之锤3, 快速逆平方根算法
static float invSqrt(float number)
{
volatile long i;
volatile float x, y;
volatile const float f = 1.5F;
x = number * 0.5F;
y = number;
i = * (( long * ) &y);
i = 0x5f375a86 - ( i >> 1 );
y = * (( float * ) &i);
y = y * ( f - ( x * y * y ) );
return y;
}
标签:oat const volatil ons lan ret cpp code float
原文地址:https://www.cnblogs.com/eqvpkbz/p/13096745.html