initial commit!
This commit is contained in:
17
libs/libgccvb/math.c
Normal file
17
libs/libgccvb/math.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "math.h"
|
||||
|
||||
float squareRootFloat(float number)
|
||||
{
|
||||
long i;
|
||||
float x, y;
|
||||
const float f = 1.5F;
|
||||
|
||||
x = number * 0.5F;
|
||||
y = number;
|
||||
i = * ( long * ) &y;
|
||||
i = 0x5f3759df - ( i >> 1 );
|
||||
y = * ( float * ) &i;
|
||||
y = y * ( f - ( x * y * y ) );
|
||||
y = y * ( f - ( x * y * y ) );
|
||||
return number * y;
|
||||
}
|
||||
Reference in New Issue
Block a user