aboutsummaryrefslogtreecommitdiffstats
path: root/complex.c
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-22 17:36:47 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-22 17:36:47 +0000
commit63f6cda81574bdeb2d5ba9e7ba48d44c8f45f7a1 (patch)
tree0e4d5dc1e40f4c706701acb7392a744bed19e3ea /complex.c
parentf9ff15055319568d09bd343e5c223bc9ca568ac9 (diff)
downloadruby-63f6cda81574bdeb2d5ba9e7ba48d44c8f45f7a1.tar.gz
* 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
Diffstat (limited to 'complex.c')
-rw-r--r--complex.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/complex.c b/complex.c
index 996aed1ac0..6a15deca04 100644
--- a/complex.c
+++ b/complex.c
@@ -443,7 +443,6 @@ nucomp_s_canonicalize_internal(VALUE klass, VALUE real, VALUE imag)
*
* 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 @@ f_addsub(VALUE self, VALUE other,
* 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 @@ nucomp_add(VALUE self, VALUE other)
* 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 @@ nucomp_sub(VALUE self, VALUE other)
* 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)