зеркало из https://github.com/github/ruby.git
* bignum.c (rb_integer_float_cmp): rename a local variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
cf469774d1
Коммит
858a832d40
|
@ -1,3 +1,7 @@
|
||||||
|
Mon Jul 16 19:02:31 2012 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* bignum.c (rb_integer_float_cmp): rename a local variable.
|
||||||
|
|
||||||
Mon Jul 16 18:40:26 2012 Tanaka Akira <akr@fsij.org>
|
Mon Jul 16 18:40:26 2012 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* bignum.c (rb_integer_float_cmp): renamed from rb_big_float_cmp.
|
* bignum.c (rb_integer_float_cmp): renamed from rb_big_float_cmp.
|
||||||
|
|
14
bignum.c
14
bignum.c
|
@ -1434,23 +1434,23 @@ rb_big_to_f(VALUE x)
|
||||||
VALUE
|
VALUE
|
||||||
rb_integer_float_cmp(VALUE x, VALUE y)
|
rb_integer_float_cmp(VALUE x, VALUE y)
|
||||||
{
|
{
|
||||||
double a = RFLOAT_VALUE(y);
|
double yd = RFLOAT_VALUE(y);
|
||||||
double yi, yf;
|
double yi, yf;
|
||||||
VALUE rel;
|
VALUE rel;
|
||||||
|
|
||||||
if (isnan(a))
|
if (isnan(yd))
|
||||||
return Qnil;
|
return Qnil;
|
||||||
if (isinf(a)) {
|
if (isinf(yd)) {
|
||||||
if (a > 0.0) return INT2FIX(-1);
|
if (yd > 0.0) return INT2FIX(-1);
|
||||||
else return INT2FIX(1);
|
else return INT2FIX(1);
|
||||||
}
|
}
|
||||||
yf = modf(a, &yi);
|
yf = modf(yd, &yi);
|
||||||
if (FIXNUM_P(x)) {
|
if (FIXNUM_P(x)) {
|
||||||
#if SIZEOF_LONG * CHAR_BIT < DBL_MANT_DIG /* assume FLT_RADIX == 2 */
|
#if SIZEOF_LONG * CHAR_BIT < DBL_MANT_DIG /* assume FLT_RADIX == 2 */
|
||||||
double xd = (double)FIX2LONG(x);
|
double xd = (double)FIX2LONG(x);
|
||||||
if (xd < a)
|
if (xd < yd)
|
||||||
return INT2FIX(-1);
|
return INT2FIX(-1);
|
||||||
if (xd > a)
|
if (xd > yd)
|
||||||
return INT2FIX(1);
|
return INT2FIX(1);
|
||||||
return INT2FIX(0);
|
return INT2FIX(0);
|
||||||
#else
|
#else
|
||||||
|
|
Загрузка…
Ссылка в новой задаче