diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-19 12:53:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-19 12:53:36 +0000 |
commit | 665cc5bcf1f8819f6aa7a1f610885abe3ab55c77 (patch) | |
tree | 5b579d7d1cd3d7cf24191638871e0df8f52f6ff2 /numeric.c | |
parent | 49484c84bdf54064ca4d733444ac42140fbc179f (diff) | |
download | ruby-665cc5bcf1f8819f6aa7a1f610885abe3ab55c77.tar.gz |
fix r54193
* numeric.c (fix_cmp): invert the result as the comarison is
inverted.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -3425,7 +3425,12 @@ fix_cmp(VALUE x, VALUE y) return INT2FIX(-1); } else if (RB_TYPE_P(y, T_BIGNUM)) { - return rb_big_cmp(y, x); + VALUE cmp = rb_big_cmp(y, x); + switch (cmp) { + case INT2FIX(+1): return INT2FIX(-1); + case INT2FIX(-1): return INT2FIX(+1); + } + return cmp; } else if (RB_TYPE_P(y, T_FLOAT)) { return rb_integer_float_cmp(x, y); |