aboutsummaryrefslogtreecommitdiffstats
path: root/ext/bigdecimal
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-11 14:43:23 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-11 14:43:23 +0000
commitc1de2f4e3aa23cac7973ceb3f6c5477924c0d0ee (patch)
tree809501c78c6314b9024a3cbcc3fb9428298af766 /ext/bigdecimal
parentab67419b755af54aeee3319a1cddb62408f1dcc9 (diff)
downloadruby-c1de2f4e3aa23cac7973ceb3f6c5477924c0d0ee.tar.gz
* bignum.c (rb_big_cmp): Specialize a comparison to zero.
* ext/bigdecimal/bigdecimal.c (is_negative): Use rb_big_cmp instead of RBIGNUM_NEGATIVE_P. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal')
-rw-r--r--ext/bigdecimal/bigdecimal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 206e5d3f5a..f426a45cef 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -2095,7 +2095,7 @@ is_negative(VALUE x)
return FIX2LONG(x) < 0;
}
else if (RB_TYPE_P(x, T_BIGNUM)) {
- return RBIGNUM_NEGATIVE_P(x);
+ return FIX2INT(rb_big_cmp(x, INT2FIX(0))) < 0;
}
else if (RB_TYPE_P(x, T_FLOAT)) {
return RFLOAT_VALUE(x) < 0.0;