summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-10-06 03:28:28 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-10-06 03:28:28 +0000
commit75ff8fdb16fa0a733512e61350c9844ea530ad35 (patch)
treea057e60543c77d6e20ea2e91928928df80b2b6d3 /numeric.c
parent5d71c8d89c6bd7af934e7a8de5882cda2991711b (diff)
join 1.1c6
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1dev@310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index c88558bc1e..d1921f3898 100644
--- a/numeric.c
+++ b/numeric.c
@@ -87,6 +87,14 @@ rb_num_coerce_bin(x, y)
}
static VALUE
+num_clone(x)
+ VALUE x;
+{
+ /* Numerics are immutable values, which need not to copy */
+ return x;
+}
+
+static VALUE
num_uplus(num)
VALUE num;
{
@@ -1354,6 +1362,7 @@ Init_Numeric()
rb_include_module(rb_cNumeric, rb_mComparable);
rb_define_method(rb_cNumeric, "coerce", num_coerce, 1);
+ rb_define_method(rb_cNumeric, "clone", num_clone, 0);
rb_define_method(rb_cNumeric, "+@", num_uplus, 0);
rb_define_method(rb_cNumeric, "-@", num_uminus, 0);