* 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
This commit is contained in:
parent
c1de2f4e3a
commit
09e6766d1a
@ -1,9 +1,10 @@
|
|||||||
Tue Feb 11 23:42:27 2014 Tanaka Akira <akr@fsij.org>
|
Tue Feb 11 23:54:40 2014 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* bignum.c (rb_big_cmp): Specialize a comparison to zero.
|
* bignum.c (rb_big_cmp): Specialize a comparison to zero.
|
||||||
|
|
||||||
* ext/bigdecimal/bigdecimal.c (is_negative): Use rb_big_cmp instead of
|
* ext/bigdecimal/bigdecimal.c (is_negative): Use rb_big_cmp instead of
|
||||||
RBIGNUM_NEGATIVE_P.
|
RBIGNUM_NEGATIVE_P.
|
||||||
|
(BigMath_s_log): Ditto.
|
||||||
|
|
||||||
Tue Feb 11 22:59:10 2014 Tanaka Akira <akr@fsij.org>
|
Tue Feb 11 22:59:10 2014 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
@ -2874,8 +2874,9 @@ BigMath_s_log(VALUE klass, VALUE x, VALUE vprec)
|
|||||||
goto get_vp_value;
|
goto get_vp_value;
|
||||||
|
|
||||||
case T_BIGNUM:
|
case T_BIGNUM:
|
||||||
zero = RBIGNUM_ZERO_P(x);
|
i = FIX2INT(rb_big_cmp(x, INT2FIX(0)));
|
||||||
negative = RBIGNUM_NEGATIVE_P(x);
|
zero = i == 0;
|
||||||
|
negative = i < 0;
|
||||||
get_vp_value:
|
get_vp_value:
|
||||||
if (zero || negative) break;
|
if (zero || negative) break;
|
||||||
vx = GetVpValue(x, 0);
|
vx = GetVpValue(x, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user