ruby-changes:37962
From: gogotanaka <ko1@a...>
Date: Sat, 21 Mar 2015 21:32:26 +0900 (JST)
Subject: [ruby-changes:37962] gogotanaka:r50043 (trunk): complex.c: [DOC] mention about Complex literal.
gogotanaka 2015-03-21 21:32:09 +0900 (Sat, 21 Mar 2015) New Revision: 50043 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50043 Log: complex.c: [DOC] mention about Complex literal. Modified files: trunk/complex.c Index: complex.c =================================================================== --- complex.c (revision 50042) +++ complex.c (revision 50043) @@ -2088,9 +2088,10 @@ float_arg(VALUE self) https://github.com/ruby/ruby/blob/trunk/complex.c#L2088 * 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/