Skip to content

Commit 8b6ceb9

Browse files
committed
Implement rb_big_sign()
1 parent b0b32da commit 8b6ceb9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/c/cext/ruby.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,10 @@ unsigned long rb_big2ulong(VALUE x) {
671671
return polyglot_as_i64(RUBY_CEXT_INVOKE_NO_WRAP("rb_num2ulong", x));
672672
}
673673

674+
int rb_big_sign(VALUE x) {
675+
return RTEST(RUBY_INVOKE(x, ">=", INT2FIX(0))) ? 1 : 0;
676+
}
677+
674678
VALUE rb_big_cmp(VALUE x, VALUE y) {
675679
return RUBY_INVOKE(x, "<=>", y);
676680
}

0 commit comments

Comments
 (0)