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 --- complex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'complex.c') diff --git a/complex.c b/complex.c index ab41520b48..7b387b94db 100644 --- a/complex.c +++ b/complex.c @@ -1093,7 +1093,7 @@ nucomp_to_f(VALUE self) if (k_float_p(dat->image) || !f_zero_p(dat->image)) { VALUE s = f_to_s(self); - rb_raise(rb_eRangeError, "can't convert %s into Integer", + rb_raise(rb_eRangeError, "can't convert %s into Float", StringValuePtr(s)); } return f_to_f(dat->real); @@ -1106,7 +1106,7 @@ nucomp_to_r(VALUE self) if (k_float_p(dat->image) || !f_zero_p(dat->image)) { VALUE s = f_to_s(self); - rb_raise(rb_eRangeError, "can't convert %s into Integer", + rb_raise(rb_eRangeError, "can't convert %s into Rational", StringValuePtr(s)); } return f_to_r(dat->real); -- cgit v1.2.3