diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-14 09:27:23 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-14 09:27:23 +0000 |
commit | 3827c23af571895a76153c006a07136704c3d33e (patch) | |
tree | 54d928d4f744e998b677b674efe062c347fa6715 | |
parent | 990b23bbbc991f7f2c9778fd85ba0a3aa773dbdb (diff) | |
download | ruby-3827c23af571895a76153c006a07136704c3d33e.tar.gz |
* object.c: Improve documentation for Integer conversion.
[ruby-core:71661][Bug #11736][ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | object.c | 9 |
2 files changed, 11 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Fri Oct 14 18:27:18 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org> + + * object.c: Improve documentation for Integer conversion. + [ruby-core:71661][Bug #11736][ci skip] + Fri Oct 14 18:00:20 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org> * lib/logger.rb: Improve Logger.new option documentation. @@ -2968,11 +2968,14 @@ FUNC_MINIMIZED(static VALUE rb_f_float(VALUE obj, VALUE arg)); * Float(arg) -> float * * Returns <i>arg</i> converted to a float. Numeric types are converted - * directly, the rest are converted using <i>arg</i>.to_f. + * directly, and with exception to string and nil the rest are converted using <i>arg</i>.to_f. + * Converting a <code>string</code> with invalid characters will result in a <code>ArgumentError</code>. * Converting <code>nil</code> generates a <code>TypeError</code>. * - * Float(1) #=> 1.0 - * Float("123.456") #=> 123.456 + * Float(1) #=> 1.0 + * Float("123.456") #=> 123.456 + * Float("123.0_badstring") #=> ArgumentError: invalid value for Float(): "123.0_badstring" + * Float(nil) #=> TypeError: can't convert nil into Float */ static VALUE |