Posted By

Feb30th1712 on 01/14/08


Tagged

c InvSqrt


Versions (?)

The famous InvSqrt()


 / Published in: C
 

Unknown author

  1. float InvSqrt (float x)
  2. {
  3. float xhalf = 0.5F * x;
  4. int i = * (int *) &x;
  5. i = 0x5F3759DF - (i >> 1);
  6. x = * (float *) &i;
  7. x = x * (1.5F - xhalf * x * x);
  8. return x;
  9. }

Report this snippet  

You need to login to post a comment.