mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
b8118e9645
commit
f970ffedae
6 changed files with 32 additions and 14 deletions
|
@ -415,7 +415,7 @@ class TestFloat < Test::Unit::TestCase
|
|||
assert_raise(TypeError) { Float(nil) }
|
||||
o = Object.new
|
||||
def o.to_f; inf = 1.0/0.0; inf/inf; end
|
||||
assert_raise(ArgumentError) { Float(o) }
|
||||
assert(Float(o).nan?)
|
||||
end
|
||||
|
||||
def test_num2dbl
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue