summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
Diffstat (limited to 'math.c')
-rw-r--r--math.c15
1 files changed, 1 insertions, 14 deletions
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);\