From 98454a6da81685775f663587f6df9670e0de0d9c Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 31 Dec 2008 14:30:50 +0000 Subject: * object.c (rb_to_float): replaced by to_flo definition from math.c [ruby-dev:37668] * math.c (Need_Float): use rb_to_float(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- math.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'math.c') diff --git a/math.c b/math.c index 3ac543150b..63a386360a 100644 --- a/math.c +++ b/math.c @@ -15,20 +15,7 @@ VALUE rb_mMath; -static VALUE -to_flo(VALUE x) -{ - if (!rb_obj_is_kind_of(x, rb_cNumeric)) { - rb_raise(rb_eTypeError, "can't convert %s into Float", - NIL_P(x) ? "nil" : - x == Qtrue ? "true" : - x == Qfalse ? "false" : - rb_obj_classname(x)); - } - return rb_convert_type(x, T_FLOAT, "Float", "to_f"); -} - -#define Need_Float(x) (x) = to_flo(x) +#define Need_Float(x) (x) = rb_to_float(x) #define Need_Float2(x,y) do {\ Need_Float(x);\ Need_Float(y);\ -- cgit v1.2.3