From 75ff8fdb16fa0a733512e61350c9844ea530ad35 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 6 Oct 1998 03:28:28 +0000 Subject: join 1.1c6 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1dev@310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index c88558bc1e..d1921f3898 100644 --- a/numeric.c +++ b/numeric.c @@ -86,6 +86,14 @@ rb_num_coerce_bin(x, y) return rb_funcall(x, rb_frame_last_func(), 1, 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); -- cgit v1.2.3