From ludwig: This one fixes a rendering error

This commit is contained in:
Zachary Slater committed 2005-08-27 18:11:08 +00:00
1 parent 916cb54d72
commit d54f831dd7
2 files changed
+14 -10

No files matched your search

+7 -5
View File
@@ -131,15 +131,17 @@ SquareRootFloat
================
*/
float SquareRootFloat(float number) {
long i;
union {
float f;
int i;
} t;
float x, y;
const float f = 1.5F;
x = number * 0.5F;
y = number;
i = * ( long * ) &y;
i = 0x5f3759df - ( i >> 1 );
y = * ( float * ) &i;
t.f = number;
t.i = 0x5f3759df - ( t.i >> 1 );
y = t.f;
y = y * ( f - ( x * y * y ) );
y = y * ( f - ( x * y * y ) );
return number * y;