summaryrefslogtreecommitdiff
path: root/ext/bigdecimal
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-11 14:55:37 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-02-11 14:55:37 +0000
commit09e6766d1acbc36c6227896af348d8d21ea2a1b2 (patch)
treea4bffe4dedc8611a47c4c00e4530dc75476d8b49 /ext/bigdecimal
parentc1de2f4e3aa23cac7973ceb3f6c5477924c0d0ee (diff)
* ext/bigdecimal/bigdecimal.c (BigMath_s_log): Use rb_big_cmp instead of
RBIGNUM_NEGATIVE_P. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal')
-rw-r--r--ext/bigdecimal/bigdecimal.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index f426a45..ffc6613 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -2874,8 +2874,9 @@ BigMath_s_log(VALUE klass, VALUE x, VALUE vprec)
goto get_vp_value;
case T_BIGNUM:
- zero = RBIGNUM_ZERO_P(x);
- negative = RBIGNUM_NEGATIVE_P(x);
+ i = FIX2INT(rb_big_cmp(x, INT2FIX(0)));
+ zero = i == 0;
+ negative = i < 0;
get_vp_value:
if (zero || negative) break;
vx = GetVpValue(x, 0);