Origin of Quake3's Fast InvSqrt()

3 views
Skip to first unread message

Ang

unread,
Dec 5, 2006, 2:17:09 PM12/5/06
to Yang Zhang (Ang)'s Group
float InvSqrt(float x){
float xhalf=0.5f*x;
long i=*(long*)&x;
i=0x5f3759df - (i>>1);
x=*(float *)&i;
x=x*(1.5f-xhalf*x*x);
return x;
}

Reply all
Reply to author
Forward
0 new messages