ruby-changes:12083
From: tadf <ko1@a...>
Date: Sat, 20 Jun 2009 06:58:09 +0900 (JST)
Subject: [ruby-changes:12083] Ruby:r23753 (trunk): * complex.c: edited rdoc.
tadf 2009-06-20 06:57:51 +0900 (Sat, 20 Jun 2009) New Revision: 23753 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23753 Log: * complex.c: edited rdoc. * rational.c: ditto. Modified files: trunk/ChangeLog trunk/complex.c trunk/lib/complex.rb trunk/lib/rational.rb trunk/numeric.c trunk/rational.c Index: complex.c =================================================================== --- complex.c (revision 23752) +++ complex.c (revision 23753) @@ -1311,24 +1311,6 @@ #define id_gsub_bang rb_intern("gsub!") #define f_gsub_bang(x,y,z) rb_funcall(x, id_gsub_bang, 2, y, z) -/* - * call-seq: - * string.to_c => complex - * - * Returns a complex which denotes string form. - * - * For example: - * - * '9'.to_c #=> (9+0i) - * '-3/2'.to_c #=> ((-3/2)+0i) - * '-i'.to_c #=> (0-1i) - * '45i'.to_c #=> (0+45i) - * '3-4i'.to_c #=> (3-4i) - * '-4e2-4e-2i'.to_c #=> (-400.0-0.04i) - * '-0.0-0.0i'.to_c #=> (-0.0-0.0i) - * '1/2+3/4i'.to_c #=> ((1/2)+(3/4)*i) - * 'ruby'.to_c #=> (0+0i) - */ static VALUE string_to_c_internal(VALUE self) { @@ -1428,6 +1410,24 @@ #define id_gsub rb_intern("gsub") #define f_gsub(x,y,z) rb_funcall(x, id_gsub, 2, y, z) +/* + * call-seq: + * str.to_c => complex + * + * Returns a complex which denotes string form. + * + * For example: + * + * '9'.to_c #=> (9+0i) + * '-3/2'.to_c #=> ((-3/2)+0i) + * '-i'.to_c #=> (0-1i) + * '45i'.to_c #=> (0+45i) + * '3-4i'.to_c #=> (3-4i) + * '-4e2-4e-2i'.to_c #=> (-400.0-0.04i) + * '-0.0-0.0i'.to_c #=> (-0.0-0.0i) + * '1/2+3/4i'.to_c #=> ((1/2)+(3/4)*i) + * 'ruby'.to_c #=> (0+0i) + */ static VALUE string_to_c(VALUE self) { @@ -1591,7 +1591,7 @@ * call-seq: * num.rect => array * - * This means [num, 0]. + * Returns an array [num, 0]. */ static VALUE numeric_rect(VALUE self) @@ -1603,7 +1603,7 @@ * call-seq: * num.polar => array * - * This means [num.abs, num.arg]. + * Returns an array [num.abs, num.arg]. */ static VALUE numeric_polar(VALUE self) @@ -1613,8 +1613,8 @@ /* * call-seq: - * cmp.conj => self - * cmp.conjucate => self + * num.conj => self + * num.conjucate => self * * Returns self. */ Index: ChangeLog =================================================================== --- ChangeLog (revision 23752) +++ ChangeLog (revision 23753) @@ -1,8 +1,14 @@ +Sat Jun 20 06:56:31 2009 Tadayoshi Funaba <tadf@d...> + + * complex.c: edited rdoc. + + * rational.c: ditto. + Sat Jun 20 05:08:59 2009 Tadayoshi Funaba <tadf@d...> - * complex.c; edited rdoc. + * complex.c: edited rdoc. - * rational.c; ditto. + * rational.c: ditto. Sat Jun 20 04:30:35 2009 Tadayoshi Funaba <tadf@d...> Index: lib/rational.rb =================================================================== --- lib/rational.rb (revision 23752) +++ lib/rational.rb (revision 23753) @@ -1,3 +1,5 @@ +# :enddoc: + class Fixnum alias quof fdiv Index: lib/complex.rb =================================================================== --- lib/complex.rb (revision 23752) +++ lib/complex.rb (revision 23753) @@ -1,3 +1,5 @@ +# :enddoc: + require 'cmath' unless defined?(Math.exp!) Index: numeric.c =================================================================== --- numeric.c (revision 23752) +++ numeric.c (revision 23753) @@ -425,8 +425,8 @@ /* * call-seq: - * num.abs => num or numeric - * num.magnitude => num or numeric + * num.abs => num + * num.magnitude => num * * Returns the absolute value of <i>num</i>. * @@ -1172,7 +1172,7 @@ /* * call-seq: * flt.abs => float - * flt.magnitude => num or numeric + * flt.magnitude => float * * Returns the absolute value of <i>flt</i>. * Index: rational.c =================================================================== --- rational.c (revision 23752) +++ rational.c (revision 23753) @@ -1723,6 +1723,12 @@ return f_numerator(f_to_r(self)); } +/* + * call-seq: + * num.denominator => integer + * + * Returns the denominator of _num_ as an +Integer+ object. + */ static VALUE numeric_denominator(VALUE self) { @@ -2009,7 +2015,7 @@ /* * call-seq: - * string.to_r => rational + * str.to_r => rational * * Returns a +Rational+ object representing _string_ as a rational number. * Leading and trailing whitespace is ignored. Underscores may be used to -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/