Need to convert the return value of rb_big_cmp
This commit is contained in:
parent
f289f8ae3a
commit
7da06c04b2
@ -2766,7 +2766,7 @@ rb_big_convert_to_BigDecimal(VALUE val, RB_UNUSED_VAR(size_t digs), int raise_ex
|
|||||||
assert(RB_TYPE_P(val, T_BIGNUM));
|
assert(RB_TYPE_P(val, T_BIGNUM));
|
||||||
|
|
||||||
size_t size = rb_absint_size(val, NULL);
|
size_t size = rb_absint_size(val, NULL);
|
||||||
int sign = rb_big_cmp(val, INT2FIX(0));
|
int sign = FIX2INT(rb_big_cmp(val, INT2FIX(0)));
|
||||||
if (size <= sizeof(long)) {
|
if (size <= sizeof(long)) {
|
||||||
if (sign < 0) {
|
if (sign < 0) {
|
||||||
return rb_int64_convert_to_BigDecimal(NUM2LONG(val), digs, raise_exception);
|
return rb_int64_convert_to_BigDecimal(NUM2LONG(val), digs, raise_exception);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user