1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Get rid of implicit expansion to long double on ix86

This commit is contained in:
Nobuyoshi Nakada 2021-11-08 16:05:04 +09:00
parent 395738e8a5
commit 7cc4e147fc
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -2546,7 +2546,7 @@ double
ruby_float_step_size(double beg, double end, double unit, int excl)
{
const double epsilon = DBL_EPSILON;
double n, err;
double d, n, err;
if (unit == 0) {
return HUGE_VAL;
@ -2563,24 +2563,26 @@ ruby_float_step_size(double beg, double end, double unit, int excl)
n = 0;
else
n = floor(n - err);
d = +((n + 1) * unit) + beg;
if (beg < end) {
if ((n+1)*unit+beg < end)
if (d < end)
n++;
}
else if (beg > end) {
if ((n+1)*unit+beg > end)
if (d > end)
n++;
}
}
else {
if (n<0) return 0;
n = floor(n + err);
d = +((n + 1) * unit) + beg;
if (beg < end) {
if ((n+1)*unit+beg <= end)
if (d <= end)
n++;
}
else if (beg > end) {
if ((n+1)*unit+beg >= end)
if (d >= end)
n++;
}
}