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

Use FIX2LONG instead of FIX2INT like 26843cbcd0

This commit is contained in:
NARUSE, Yui 2019-11-07 18:53:51 +09:00
parent 26843cbcd0
commit 6aa80d5583

View file

@ -1507,7 +1507,7 @@ rb_float_gt(VALUE x, VALUE y)
if (RB_TYPE_P(y, T_FIXNUM) || RB_TYPE_P(y, T_BIGNUM)) { if (RB_TYPE_P(y, T_FIXNUM) || RB_TYPE_P(y, T_BIGNUM)) {
VALUE rel = rb_integer_float_cmp(y, x); VALUE rel = rb_integer_float_cmp(y, x);
if (FIXNUM_P(rel)) if (FIXNUM_P(rel))
return -FIX2INT(rel) > 0 ? Qtrue : Qfalse; return -FIX2LONG(rel) > 0 ? Qtrue : Qfalse;
return Qfalse; return Qfalse;
} }
else if (RB_TYPE_P(y, T_FLOAT)) { else if (RB_TYPE_P(y, T_FLOAT)) {
@ -1544,7 +1544,7 @@ flo_ge(VALUE x, VALUE y)
if (RB_TYPE_P(y, T_FIXNUM) || RB_TYPE_P(y, T_BIGNUM)) { if (RB_TYPE_P(y, T_FIXNUM) || RB_TYPE_P(y, T_BIGNUM)) {
VALUE rel = rb_integer_float_cmp(y, x); VALUE rel = rb_integer_float_cmp(y, x);
if (FIXNUM_P(rel)) if (FIXNUM_P(rel))
return -FIX2INT(rel) >= 0 ? Qtrue : Qfalse; return -FIX2LONG(rel) >= 0 ? Qtrue : Qfalse;
return Qfalse; return Qfalse;
} }
else if (RB_TYPE_P(y, T_FLOAT)) { else if (RB_TYPE_P(y, T_FLOAT)) {
@ -1581,7 +1581,7 @@ flo_lt(VALUE x, VALUE y)
if (RB_TYPE_P(y, T_FIXNUM) || RB_TYPE_P(y, T_BIGNUM)) { if (RB_TYPE_P(y, T_FIXNUM) || RB_TYPE_P(y, T_BIGNUM)) {
VALUE rel = rb_integer_float_cmp(y, x); VALUE rel = rb_integer_float_cmp(y, x);
if (FIXNUM_P(rel)) if (FIXNUM_P(rel))
return -FIX2INT(rel) < 0 ? Qtrue : Qfalse; return -FIX2LONG(rel) < 0 ? Qtrue : Qfalse;
return Qfalse; return Qfalse;
} }
else if (RB_TYPE_P(y, T_FLOAT)) { else if (RB_TYPE_P(y, T_FLOAT)) {
@ -1618,7 +1618,7 @@ flo_le(VALUE x, VALUE y)
if (RB_TYPE_P(y, T_FIXNUM) || RB_TYPE_P(y, T_BIGNUM)) { if (RB_TYPE_P(y, T_FIXNUM) || RB_TYPE_P(y, T_BIGNUM)) {
VALUE rel = rb_integer_float_cmp(y, x); VALUE rel = rb_integer_float_cmp(y, x);
if (FIXNUM_P(rel)) if (FIXNUM_P(rel))
return -FIX2INT(rel) <= 0 ? Qtrue : Qfalse; return -FIX2LONG(rel) <= 0 ? Qtrue : Qfalse;
return Qfalse; return Qfalse;
} }
else if (RB_TYPE_P(y, T_FLOAT)) { else if (RB_TYPE_P(y, T_FLOAT)) {