diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-01 06:42:59 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-01 06:42:59 +0000 |
commit | a1428471182d77d4f40c30d467bf701b67c86aae (patch) | |
tree | 99ff997d89d032176ab5e0ff95deac40c044d0bf /math.c | |
parent | 2c8756f2c8512e763afea4b63462397a14f09ece (diff) |
merges r21214 from trunk into ruby_1_9_1.
* 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/branches/ruby_1_9_1@21232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 15 |
1 files changed, 1 insertions, 14 deletions
@@ -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);\ |