8000 * complex.c : few improvement on the documentation by robin850 · Pull Request #184 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

* complex.c : few improvement on the documentation #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Al 8000 ready on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions complex.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,10 @@ nucomp_s_canonicalize_internal(VALUE klass, VALUE real, VALUE imag)
* Complex.rectangular(real[, imag]) -> complex
*
* Returns a complex object which denotes the given rectangular form.
*
* 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)
Expand Down Expand Up @@ -679,7 +683,11 @@ f_addsub(VALUE self, VALUE other,
* call-seq:
* cmp + numeric -> complex
*
* Performs addition.
* Performs addition on the first member of the Complex.
*
* Complex(5, 2) + 3 # => (8+2i)
* Complex(11, 3) + 4 # => (15+3i)
*
*/
static VALUE
nucomp_add(VALUE self, VALUE other)
Expand All @@ -691,7 +699,10 @@ nucomp_add(VALUE self, VALUE other)
* call-seq:
* cmp - numeric -> complex
*
* Performs subtraction.
* Performs subtraction on the first member of the Complex.
*
* Complex(33, 12) - 10 # => (23+12i)
* Complex(12.4, 3.5) - 5 # => (7.4+3.5i)
*/
static VALUE
nucomp_sub(VALUE self, VALUE other)
Expand All @@ -703,7 +714,10 @@ nucomp_sub(VALUE self, VALUE other)
* call-seq:
* cmp * numeric -> complex
*
* Performs multiplication.
* Performs multiplication on the two members.
*
* Complex(78, 58) * 10 # => (780+580i)
* Complex(5.6, 3.4) * 10 # => (56+34i)
*/
static VALUE
nucomp_mul(VALUE self, VALUE other)
Expand Down
0