This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.

numerator

        # Complex.numerator

(from ruby core)
---
    cmp.numerator  ->  numeric

---

Returns the numerator.

        1   2       3+4i  <-  numerator
        - + -i  ->  ----
        2   3        6    <-  denominator

    c = Complex('1/2+2/3i')  #=> ((1/2)+(2/3)*i)
    n = c.numerator          #=> (3+4i)
    d = c.denominator        #=> 6
    n / d                    #=> ((1/2)+(2/3)*i)
    Complex(Rational(n.real, d), Rational(n.imag, d))
                             #=> ((1/2)+(2/3)*i)

See denominator.



      

This is MURDOC! A Ruby documentation browser inspired by Smalltalk-80. It allows you to learn about Ruby by browsing through its class hierarchies, and see any of its methods.