mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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:
parent
cf469774d1
commit
858a832d40
2 changed files with 11 additions and 7 deletions
|
@ -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>
|
||||
|
||||
* 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
|
||||
rb_integer_float_cmp(VALUE x, VALUE y)
|
||||
{
|
||||
double a = RFLOAT_VALUE(y);
|
||||
double yd = RFLOAT_VALUE(y);
|
||||
double yi, yf;
|
||||
VALUE rel;
|
||||
|
||||
if (isnan(a))
|
||||
if (isnan(yd))
|
||||
return Qnil;
|
||||
if (isinf(a)) {
|
||||
if (a > 0.0) return INT2FIX(-1);
|
||||
if (isinf(yd)) {
|
||||
if (yd > 0.0) return INT2FIX(-1);
|
||||
else return INT2FIX(1);
|
||||
}
|
||||
yf = modf(a, &yi);
|
||||
yf = modf(yd, &yi);
|
||||
if (FIXNUM_P(x)) {
|
||||
#if SIZEOF_LONG * CHAR_BIT < DBL_MANT_DIG /* assume FLT_RADIX == 2 */
|
||||
double xd = (double)FIX2LONG(x);
|
||||
if (xd < a)
|
||||
if (xd < yd)
|
||||
return INT2FIX(-1);
|
||||
if (xd > a)
|
||||
if (xd > yd)
|
||||
return INT2FIX(1);
|
||||
return INT2FIX(0);
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue