diff options
author | wyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-22 17:18:04 +0000 |
---|---|---|
committer | wyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-06-22 17:18:04 +0000 |
commit | 2c0b73f16a997b6b957e435d808a0b60e6afd9d3 (patch) | |
tree | 1b0742d37170cc97bb8c5b00aea2ffc98347c4b3 /object.c | |
parent | 9eb9ad060856b6dbcf5a417a2563ec02d5bb6fcf (diff) |
object.c: Backport #2364 [ruby-core:26733]; Allow result of to_f to be NaN to permit conversion from BigDecimal('NaN') to Float.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@28392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -2386,11 +2386,7 @@ rb_Float(val) 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"); } } } |