8000 * complex.c: Fix examples of r36993. · ruby/ruby@63f6cda · GitHub
[go: up one dir, main page]

Skip to content

Commit 63f6cda

Browse files
committed
* complex.c: Fix examples of r36993.
Keep the simple definition, mathematics define the result. Based on patch by Robin Dupret. Fixes #188 on github. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent f9ff150 commit 63f6cda

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Sun Sep 23 02:33:37 2012 Benoit Daloze <eregontp@gmail.com>
2+
3+
* complex.c: Fix examples of r36993.
4+
Keep the simple definition, mathematics define the result.
5+
Based on patch by Robin Dupret. Fixes #188 on github.
6+
17
Sat Sep 22 07:15:00 2012 Zachary Scott <zzak@ruby-lang.org>
28

39
* ext/ripper/lib/ripper.rb:

complex.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,6 @@ nucomp_s_canonicalize_internal(VALUE klass, VALUE real, VALUE imag)
443443
*
444444
* For example:
445445
* Complex.rect(12, 2) # => (12+2i)
446-
* Complex.rect(0, 17) # => (0+17i)
447446
*/
448447
static VALUE
449448
nucomp_s_new(int argc, VALUE *argv, VALUE klass)
@@ -683,10 +682,11 @@ f_addsub(VALUE self, VALUE other,
683682
* call-seq:
684683
* cmp + numeric -> complex
685684
*
686-
* Performs addition on the first member of the Complex.
685+
* Performs addition.
687686
*
688687
* Complex(5, 2) + 3 # => (8+2i)
689-
* Complex(11, 3) + 4 # => (15+3i)
688+
* Complex(5, 2) + 3.i # => (5+5i)
689+
* Complex(5, 2) + Complex(3, 4) # => (8+6i)
690690
*
691691
*/
692692
static VALUE
@@ -699,10 +699,9 @@ nucomp_add(VALUE self, VALUE other)
699699
* call-seq:
700700
* cmp - numeric -> complex
701701
*
702-
* Performs subtraction on the first member of the Complex.
702+
* Performs subtraction.
703703
*
704704
* Complex(33, 12) - 10 # => (23+12i)
705-
* Complex(12.4, 3.5) - 5 # => (7.4+3.5i)
706705
*/
707706
static VALUE
708707
nucomp_sub(VALUE self, VALUE other)
@@ -714,10 +713,9 @@ nucomp_sub(VALUE self, VALUE other)
714713
* call-seq:
715714
* cmp * numeric -> complex
716715
*
717-
* Performs multiplication on the two members.
716+
* Performs multiplication.
718717
*
719718
* Complex(78, 58) * 10 # => (780+580i)
720-
* Complex(5.6, 3.4) * 10 # => (56+34i)
721719
*/
722720
static VALUE
723721
nucomp_mul(VALUE self, VALUE other)

0 commit comments

Comments
 (0)
0