diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-11 16:06:11 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-11-11 16:06:11 +0000 |
commit | 627eec87257d22022d0c67fad697be8daaafef5a (patch) | |
tree | f56907e293dcabfb18a7bff93d7eec7ca4f6fa8d | |
parent | 1f32d9f495f7ace063cf57fcd28192f65afb5611 (diff) |
merge revision(s) 56421,56422: [Backport #11736]
* object.c: Improve documentation for Integer conversion.
[ruby-core:71661][Bug #11736][ci skip]
* object.c: Improve documentation for Float conversion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@56722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | object.c | 9 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 12 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Sat Nov 12 01:05:45 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org> + + * object.c: Improve documentation for Float conversion. + [ruby-core:71661][Bug #11736][ci skip] + Sat Nov 12 00:50:35 2016 Nobuyoshi Nakada <nobu@ruby-lang.org> * proc.c (mnew_internal): follow the original class, not to loop @@ -2943,11 +2943,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 @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.3.2" #define RUBY_RELEASE_DATE "2016-11-12" -#define RUBY_PATCHLEVEL 211 +#define RUBY_PATCHLEVEL 212 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 11 |