aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--object.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 653bdf8cb7..afe31ff233 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/object.c b/object.c
index 451746150d..9769c1ee26 100644
--- a/object.c
+++ b/object.c
@@ -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