-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[DOC] RDoc for Complex #9260
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.
Already on GitHub? Sign in to your account
[DOC] RDoc for Complex #9260
Conversation
complex.c
Outdated
* Complex(Rational(n.real, d), Rational(n.imag, d)) | ||
* #=> ((1/2)+(2/3)*i) | ||
* See denominator. | ||
* Related: Complex.denominator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean Complex#denominator
?
* Related: Complex.denominator. | |
* Related: Complex#denominator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
complex.c
Outdated
* This result is computed thus: | ||
* | ||
* 1 2 3+4i <- numerator | ||
* - + -i -> ---- | ||
* 2 3 6 <- denominator | ||
* # Numerators and denominators for c.real and c.imag. | ||
* c.real.numerator # => 2 | ||
* c.real.denominator # => 3 | ||
* c.imag.numerator # => 3 | ||
* c.imag.denominator # => 4 | ||
* # Real and imaginary parts for new Complex c.numerator. | ||
* result_real = c.real.numerator * c.imag.denominator # => 8 | ||
* result_imag = c.imag.numerator * c.real.denominator # => 9 | ||
* # New Complex c.numerator (Q.E.D.). | ||
* result = Complex(result_real, result_imag) # => (8+9i) | ||
* c.numerator # => (8+9i) | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this example to be difficult to understand. Can we explain using words instead? I think the numerator is the Complex created from the numerators of the real and imaginary parts after converting them to the least common denominator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revised.
#numerator and #denominator.