Skip to content

Commit

Permalink
* complax.c: [DOC] Document number conversion of nil by @skade [fix r…
Browse files Browse the repository at this point in the history
…ubyGH-570] [ci skip]

* object.c, rational.c: ditto.

git-svn-id: svn+ssh:https://ci.ruby-lang.org/ruby/trunk@45375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
hsbt committed Mar 21, 2014
1 parent 3fb752a commit cbf4eca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions complex.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ f_complex_new2(VALUE klass, VALUE x, VALUE y)
*
* Complex(1, 2) #=> (1+2i)
* Complex('1+2i') #=> (1+2i)
* Complex(nil) #=> TypeError
* Complex(1, nil) #=> TypeError
*
* Syntax of string form:
*
Expand Down
4 changes: 3 additions & 1 deletion object.c
Original file line number Diff line number Diff line change
Expand Up @@ -2746,13 +2746,15 @@ rb_Integer(VALUE val)
* In any case, strings should be strictly conformed to numeric
* representation. This behavior is different from that of
* <code>String#to_i</code>. Non string values will be converted using
* <code>to_int</code>, and <code>to_i</code>.
* <code>to_int</code>, and <code>to_i</code>. Passing <code>nil</code>
* raises a TypeError.
*
* Integer(123.999) #=> 123
* Integer("0x1a") #=> 26
* Integer(Time.new) #=> 1204973019
* Integer("0930", 10) #=> 930
* Integer("111", 2) #=> 7
* Integer(nil) #=> TypeError
*/

static VALUE
Expand Down
2 changes: 2 additions & 0 deletions rational.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,8 @@ f_rational_new_no_reduce2(VALUE klass, VALUE x, VALUE y)
*
* Rational(1, 2) #=> (1/2)
* Rational('1/2') #=> (1/2)
* Rational(nil) #=> TypeError
* Rational(1, nil) #=> TypeError
*
* Syntax of string form:
*
Expand Down

0 comments on commit cbf4eca

Please sign in to comment.