License Public Domain
Lines 8
Permissions
Viewable by Everyone
Editable by All Siafoo Users
Hide
Bored? Check out the Recent Activity on Siafoo Join Siafoo Now or Learn More

Doom Inverse Square Root Function Atom Feed 0

In Brief Doom's semi famous inverse square root function, more info about it at: http://www.beyond3d.com/content/articles/8/
# 's
1float InvSqrt (float x){
2 float xhalf = 0.5f*x;
3 int i = *(int*)&x;
4 i = 0x5f3759df - (i>>1);
5 x = *(float*)&i;
6 x = x*(1.5f - xhalf*x*x);
7 return x;
8}

Doom's semi famous inverse square root function, more info about it at: http://www.beyond3d.com/content/articles/8/

Comments

over 8 years ago (06 Dec 2007 at 12:32 AM) by Andrew Stromberg
I can't set the owning group of this thing properly