ruby-changes:24958
From: eregon <ko1@a...>
Date: Sun, 23 Sep 2012 02:37:00 +0900 (JST)
Subject: [ruby-changes:24958] eregon:r37010 (trunk): * complex.c: Fix examples of r36993.
eregon 2012-09-23 02:36:47 +0900 (Sun, 23 Sep 2012) New Revision: 37010 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=37010 Log: * complex.c: Fix examples of r36993. Keep the simple definition, mathematics define the result. Based on patch by Robin Dupret. Fixes #188 on github. Modified files: trunk/ChangeLog trunk/complex.c Index: complex.c =================================================================== --- complex.c (revision 37009) +++ complex.c (revision 37010) @@ -443,7 +443,6 @@ * * For example: * Complex.rect(12, 2) # => (12+2i) - * Complex.rect(0, 17) # => (0+17i) */ static VALUE nucomp_s_new(int argc, VALUE *argv, VALUE klass) @@ -683,10 +682,11 @@ * call-seq: * cmp + numeric -> complex * - * Performs addition on the first member of the Complex. + * Performs addition. * * Complex(5, 2) + 3 # => (8+2i) - * Complex(11, 3) + 4 # => (15+3i) + * Complex(5, 2) + 3.i # => (5+5i) + * Complex(5, 2) + Complex(3, 4) # => (8+6i) * */ static VALUE @@ -699,10 +699,9 @@ * call-seq: * cmp - numeric -> complex * - * Performs subtraction on the first member of the Complex. + * Performs subtraction. * * Complex(33, 12) - 10 # => (23+12i) - * Complex(12.4, 3.5) - 5 # => (7.4+3.5i) */ static VALUE nucomp_sub(VALUE self, VALUE other) @@ -714,10 +713,9 @@ * call-seq: * cmp * numeric -> complex * - * Performs multiplication on the two members. + * Performs multiplication. * * Complex(78, 58) * 10 # => (780+580i) - * Complex(5.6, 3.4) * 10 # => (56+34i) */ static VALUE nucomp_mul(VALUE self, VALUE other) Index: ChangeLog =================================================================== --- ChangeLog (revision 37009) +++ ChangeLog (revision 37010) @@ -1,3 +1,9 @@ +Sun Sep 23 02:33:37 2012 Benoit Daloze <eregontp@g...> + + * complex.c: Fix examples of r36993. + Keep the simple definition, mathematics define the result. + Based on patch by Robin Dupret. Fixes #188 on github. + Sat Sep 22 07:15:00 2012 Zachary Scott <zzak@r...> * ext/ripper/lib/ripper.rb: -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/