mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
object.c (mrb_equal): support big-integers.
This commit is contained in:
@@ -68,6 +68,13 @@ mrb_equal(mrb_state *mrb, mrb_value obj1, mrb_value obj2)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
#ifdef MRB_USE_BIGINT
|
||||
if (mrb_bigint_p(obj1) && (mrb_integer_p(obj2) || mrb_bigint_p(obj2))) {
|
||||
if (mrb_bint_cmp(mrb, obj1, obj2) == 0)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
result = mrb_funcall_id(mrb, obj1, MRB_OPSYM(eq), 1, obj2);
|
||||
if (mrb_test(result)) return TRUE;
|
||||
|
||||
Reference in New Issue
Block a user