Update lmms_math.h

add fast sqrt method
This commit is contained in:
Vesa V
2014-11-29 23:22:39 +02:00
parent 64d90066d9
commit 1421631f26

View File

@@ -228,4 +228,13 @@ static inline float sqrt_neg( float val )
}
// fast approximation of square root
float fastSqrt( float n )
{
int i = *(int*) &n;
i = ( ( i - ( 1 << 23 ) ) >> 1 ) + ( 1 << 29 );
return *(float*) &i;
}
#endif