aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index 4ff50a776d..286c56a93a 100644
--- a/string.c
+++ b/string.c
@@ -2839,7 +2839,7 @@ rb_str_to_i(int argc, VALUE *argv, VALUE str)
static VALUE
rb_str_to_f(VALUE str)
{
- return rb_float_new(rb_str_to_dbl(str, Qfalse));
+ return DOUBLE2NUM(rb_str_to_dbl(str, Qfalse));
}