diff options
| author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-06 22:05:35 +0000 |
|---|---|---|
| committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-06 22:05:35 +0000 |
| commit | 09a2dd632b9a3f4233466d054388359684667cdc (patch) | |
| tree | f6d8bfe1b869e67d9acd4cef1262782c7a93d4c7 | |
| parent | 899a1f4022302964b6e61cff7ba8b7ccd3a42743 (diff) | |
* object.c (rb_Float): Allow results of to_f to be NaN [ruby-core:26733]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | object.c | 9 |
2 files changed, 7 insertions, 7 deletions
@@ -1,3 +1,8 @@ +Mon Dec 7 07:01:19 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca> + + * object.c (rb_Float): Allow results of to_f to be NaN + [ruby-core:26733] + Mon Dec 7 06:43:20 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca> * array.c (rb_ary_sample): Fix infinite loop bug [ruby-core:27075] @@ -2486,13 +2486,8 @@ rb_Float(val) break; default: - { - VALUE f = rb_convert_type(val, T_FLOAT, "Float", "to_f"); - if (isnan(RFLOAT(f)->value)) { - rb_raise(rb_eArgError, "invalid value for Float()"); - } - return f; - } + return rb_convert_type(val, T_FLOAT, "Float", "to_f"); + } } |
