mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-07-07 03:55:01 -04:00
Implement & link initial_menu
This commit is contained in:
+19
-1
@@ -2,7 +2,9 @@
|
||||
#define W_MATH_H
|
||||
#include "types.h"
|
||||
|
||||
inline float sqrtf(float x)
|
||||
/* this is needed to keep $localstatic$ variables out of the rel */
|
||||
#ifndef OPTIMIZED_SQRTF
|
||||
extern inline float sqrtf(float x)
|
||||
{
|
||||
static const double _half=.5;
|
||||
static const double _three=3.0;
|
||||
@@ -18,6 +20,22 @@ inline float sqrtf(float x)
|
||||
}
|
||||
return x;
|
||||
}
|
||||
#else
|
||||
extern inline float sqrtf(float x)
|
||||
{
|
||||
volatile float y;
|
||||
if(x > 0.0f)
|
||||
{
|
||||
double guess = __frsqrte((double)x); // returns an approximation to
|
||||
guess = .5*guess*(3.0 - guess*guess*x); // now have 12 sig bits
|
||||
guess = .5*guess*(3.0 - guess*guess*x); // now have 24 sig bits
|
||||
guess = .5*guess*(3.0 - guess*guess*x); // now have 32 sig bits
|
||||
y=(float)(x*guess);
|
||||
return y;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
#endif
|
||||
|
||||
extern inline double fabs(double x)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user