mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-07-07 03:55:01 -04:00
Partially match m_watch_my_step.c
This commit is contained in:
@@ -37,6 +37,24 @@ extern inline float sqrtf(float x)
|
||||
}
|
||||
#endif
|
||||
|
||||
// hack to get some functions matching where the static const locals are needed
|
||||
extern inline float sqrtf2(float x)
|
||||
{
|
||||
static const double _half=.5;
|
||||
static const double _three=3.0;
|
||||
volatile float y;
|
||||
if(x > 0.0f)
|
||||
{
|
||||
double guess = __frsqrte((double)x); // returns an approximation to
|
||||
guess = _half*guess*(_three - guess*guess*x); // now have 12 sig bits
|
||||
guess = _half*guess*(_three - guess*guess*x); // now have 24 sig bits
|
||||
guess = _half*guess*(_three - guess*guess*x); // now have 32 sig bits
|
||||
y=(float)(x*guess);
|
||||
return y;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
extern inline double fabs(double x)
|
||||
{
|
||||
return __fabs(x) ;
|
||||
|
||||
Reference in New Issue
Block a user