summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--benchmark/bm_int_quo.rb1
-rw-r--r--benchmark/bm_time_subsec.rb2
-rw-r--r--defs/id.def1
-rw-r--r--object.c1
4 files changed, 5 insertions, 0 deletions
diff --git a/benchmark/bm_int_quo.rb b/benchmark/bm_int_quo.rb
new file mode 100644
index 0000000..e22a3f8
--- /dev/null
+++ b/benchmark/bm_int_quo.rb
@@ -0,0 +1 @@
+5000000.times { 42.quo(3) }
diff --git a/benchmark/bm_time_subsec.rb b/benchmark/bm_time_subsec.rb
new file mode 100644
index 0000000..505021c
--- /dev/null
+++ b/benchmark/bm_time_subsec.rb
@@ -0,0 +1,2 @@
+t = Time.now
+4000000.times { t.subsec }
diff --git a/defs/id.def b/defs/id.def
index b5815b7..f30b993 100644
--- a/defs/id.def
+++ b/defs/id.def
@@ -38,6 +38,7 @@ firstline, predefined = __LINE__+1, %[\
to_a
to_s
to_i
+ to_r
bt
bt_locations
call
diff --git a/object.c b/object.c
index 88b4c56..92cea14 100644
--- a/object.c
+++ b/object.c
@@ -2619,6 +2619,7 @@ static const struct conv_method_tbl {
M(a),
M(s),
M(i),
+ M(r),
#undef M
};
#define IMPLICIT_CONVERSIONS 7