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

* bignum.c (rb_integer_float_cmp): use FIXNUM_MIN and FIXNUM_MAX,

instead of LONG_MIN and LONG_MAX.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2012-07-16 14:30:24 +00:00
parent 0e2aa330ec
commit fae19d6229
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Mon Jul 16 23:20:24 2012 Tanaka Akira <akr@fsij.org>
* bignum.c (rb_integer_float_cmp): use FIXNUM_MIN and FIXNUM_MAX,
instead of LONG_MIN and LONG_MAX.
Mon Jul 16 22:50:41 2012 Tanaka Akira <akr@fsij.org>
* numeric.c (flo_to_s): use the exponential form if the integer part

View file

@ -1455,9 +1455,9 @@ rb_integer_float_cmp(VALUE x, VALUE y)
return INT2FIX(0);
#else
long xl, yl;
if (yi < LONG_MIN)
if (yi < FIXNUM_MIN)
return INT2FIX(1);
if (LONG_MAX < yi)
if (FIXNUM_MAX+1 <= yi)
return INT2FIX(-1);
xl = FIX2LONG(x);
yl = (long)yi;