summaryrefslogtreecommitdiff
path: root/spec/ruby/optional/capi/ext/bignum_spec.c
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/optional/capi/ext/bignum_spec.c')
-rw-r--r--spec/ruby/optional/capi/ext/bignum_spec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/ruby/optional/capi/ext/bignum_spec.c b/spec/ruby/optional/capi/ext/bignum_spec.c
index a773e06436..14a51f5099 100644
--- a/spec/ruby/optional/capi/ext/bignum_spec.c
+++ b/spec/ruby/optional/capi/ext/bignum_spec.c
@@ -31,6 +31,10 @@ static VALUE bignum_spec_rb_big2ulong(VALUE self, VALUE num) {
return ULONG2NUM(rb_big2ulong(num));
}
+static VALUE bignum_spec_RBIGNUM_SIGN(VALUE self, VALUE val) {
+ return INT2FIX(RBIGNUM_SIGN(val));
+}
+
static VALUE bignum_spec_rb_big_cmp(VALUE self, VALUE x, VALUE y) {
return rb_big_cmp(x, y);
}
@@ -90,6 +94,7 @@ void Init_bignum_spec(void) {
rb_define_method(cls, "rb_big2long", bignum_spec_rb_big2long, 1);
rb_define_method(cls, "rb_big2str", bignum_spec_rb_big2str, 2);
rb_define_method(cls, "rb_big2ulong", bignum_spec_rb_big2ulong, 1);
+ rb_define_method(cls, "RBIGNUM_SIGN", bignum_spec_RBIGNUM_SIGN, 1);
rb_define_method(cls, "rb_big_cmp", bignum_spec_rb_big_cmp, 2);
rb_define_method(cls, "rb_big_pack", bignum_spec_rb_big_pack, 1);
rb_define_method(cls, "rb_big_pack_array", bignum_spec_rb_big_pack_array, 2);