Published in: C++
Unknown author
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; }
You need to login to post a comment.
C++ The Core Language
C++: The Core Language is for C programmers transitioning to C++. It's designed to get readers up to speed quickly by covering an essential subset of the language. The subset consists of features without which it's just not C++, and a handful of others that make it a reasonably useful language.
Feb30th1712 on 01/14/08
Published in: C++
Unknown author
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; }
You need to login to post a comment.