mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
complex.c: [DOC] mention about Complex literal.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e458cf5233
commit
9f2922bdcd
1 changed files with 3 additions and 2 deletions
|
@ -2088,9 +2088,10 @@ float_arg(VALUE self)
|
|||
* and i is imaginary unit. Real a equals complex a+0i
|
||||
* mathematically.
|
||||
*
|
||||
* In ruby, you can create complex object with Complex, Complex::rect,
|
||||
* Complex::polar or to_c method.
|
||||
* Complex object can be created as literal, and also by using
|
||||
* Kernel#Complex, Complex::rect, Complex::polar or to_c method.
|
||||
*
|
||||
* 2+1i #=> (2+1i)
|
||||
* Complex(1) #=> (1+0i)
|
||||
* Complex(2, 3) #=> (2+3i)
|
||||
* Complex.polar(2, 3) #=> (-1.9799849932008908+0.2822400161197344i)
|
||||
|
|
Loading…
Reference in a new issue