mirror of
https://github.com/zeldaret/tp
synced 2026-09-02 18:02:55 -04:00
Fix more nonmatchings (#2850)
* Fix GetPolyIndex and GetBgIndex, fixing a couple regallocs * Match daNpcCd2_c::checkFearSituation and daNpcCd2_c::getAnmP * Match daAlink_c::jointControll * Clean up float class checks * Move float constants to global.h
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
(sizeof(x) == sizeof(double)) ? __fpclassifyd((double)(x)) : \
|
||||
__fpclassifyl((long double)(x)) )
|
||||
#define signbit(x) ((sizeof(x) == sizeof(float)) ? __signbitf(x) : __signbitd(x))
|
||||
#define isfinite(x) ((fpclassify(x) > 2))
|
||||
#define isfinite(x) ((fpclassify(x) > FP_INFINITE))
|
||||
#define isnan(x) (fpclassify(x) == FP_NAN)
|
||||
#define isinf(x) (fpclassify(x) == FP_INFINITE)
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ inline float sqrtf(float mag) {
|
||||
return mag * tmpd;
|
||||
} else if (mag < 0.0) {
|
||||
return NAN;
|
||||
} else if (fpclassify(mag) == 1) {
|
||||
} else if (isnan(mag)) {
|
||||
return NAN;
|
||||
} else {
|
||||
return mag;
|
||||
|
||||
@@ -522,7 +522,7 @@ void __num2dec_internal(decimal* d, double x) {
|
||||
d->sign = sign;
|
||||
d->exp = 0;
|
||||
d->sig.length = 1;
|
||||
d->sig.text[0] = fpclassify(x) == 1 ? 'N' : 'I';
|
||||
d->sig.text[0] = isnan(x)? 'N' : 'I';
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -570,4 +570,4 @@ void __num2dec(const decform* form, double x, decimal* d) {
|
||||
for (i = 0; i < d->sig.length; i++) {
|
||||
d->sig.text[i] += '0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user