summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/bignum.c b/bignum.c
index 32c801afd0..fbf2778f9b 100644
--- a/bignum.c
+++ b/bignum.c
@@ -6780,6 +6780,15 @@ rb_big_aref(VALUE x, VALUE y)
return (xds[s1] & bit) ? INT2FIX(1) : INT2FIX(0);
}
+/*
+ * call-seq:
+ * big.hash -> fixnum
+ *
+ * Compute a hash based on the value of _big_.
+ *
+ * See also Object#hash.
+ */
+
VALUE
rb_big_hash(VALUE x)
{
@@ -7019,6 +7028,7 @@ Init_Bignum(void)
rb_define_method(rb_cBignum, "<=", big_le, 1);
rb_define_method(rb_cBignum, "===", rb_big_eq, 1);
rb_define_method(rb_cBignum, "eql?", rb_big_eql, 1);
+ rb_define_method(rb_cBignum, "hash", rb_big_hash, 0);
rb_define_method(rb_cBignum, "to_f", rb_big_to_f, 0);
rb_define_method(rb_cBignum, "abs", rb_big_abs, 0);
rb_define_method(rb_cBignum, "magnitude", rb_big_abs, 0);