All pastes #1291574 Raw Edit

Quake 3's Fast Inverse Square Ro

public c v1 · immutable
#1291574 ·published 2008-12-22 17:20 UTC
rendered paste body
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;}