sim/sh: use fabs instead of abs

The sh simulator incorrectly uses integer abs instead of the floating
point fabs on some floating point values, fixed in this commit.
This commit is contained in:
Andrew Burgess
2022-10-19 15:04:14 +01:00
parent b2829fcf9b
commit ffa2d04822

View File

@ -1401,7 +1401,7 @@ fsca_s (int in, double (*f) (double))
lower = result - error;
frac = frexp (lower, &exp);
lower = ldexp (ceil (ldexp (frac, 24)), exp - 24);
return abs (upper - result) >= abs (lower - result) ? upper : lower;
return fabs (upper - result) >= fabs (lower - result) ? upper : lower;
}
static float