From f970ffedaebf447da3617c1825b5365ce45a40fd Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 16 May 2008 04:17:45 +0000 Subject: * math.c (to_flo): rb_Float() accepts even strings for input. * complex.c (nucomp_to_f): fix wrong message. * complex.c (nucomp_to_r): ditto. * object.c (rb_Float): do not check NaN for error. NaN is a part of valid float values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- object.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'object.c') diff --git a/object.c b/object.c index e863edb8da..c1c60714e2 100644 --- a/object.c +++ b/object.c @@ -2148,13 +2148,7 @@ rb_Float(VALUE val) break; default: - { - VALUE f = rb_convert_type(val, T_FLOAT, "Float", "to_f"); - if (isnan(RFLOAT_VALUE(f))) { - rb_raise(rb_eArgError, "invalid value for Float()"); - } - return f; - } + return rb_convert_type(val, T_FLOAT, "Float", "to_f"); } } -- cgit v1.2.3