unsafe static float InvSqrt(float x)
{
float xhalf = 0.5f * x;
int i = *(int*)&x;
i = 0x5f3759df - (i >> 1);
x = *(float*)&i;
x = x * (1.5f - xhalf * x * x);
return x;
}
快速平方根倒数算法
猜你喜欢
转载自blog.csdn.net/KAMILLE/article/details/2540455
今日推荐
周排行