Complex

ruby/spec describes 46 methods in core/complex, and Metorex implements 44 of them. The parameters are what Method#parameters answers under Metorex.

  • Complex#*: implemented, parameters [[:req]]. Returns the numeric product of self and other:
  • Complex#**: implemented, parameters [[:req]]. Returns self raised to the power exponent:
  • Complex#+: implemented, parameters [[:req]]. Returns the sum of self and other:
  • Complex#-: implemented, parameters [[:req]]. Returns the difference of self and other:
  • Complex#-@: implemented, parameters []. Returns self, negated, which is the negation of each of its parts:
  • Complex#/: implemented, parameters [[:req]]. Returns the quotient of self and other:
  • Complex#<=>: implemented, parameters [[:req]]. Compares self and other.
  • Complex#==: implemented, parameters [[:req]]. Returns true if self.real == object.real and self.imag == object.imag:
  • Complex#abs: implemented, parameters []. Returns the absolute value (magnitude) for self; see polar coordinates: An example calling it.
  • Complex#abs2: implemented, parameters []. Returns square of the absolute value (magnitude) for self; see polar coordinates: An example calling it.
  • Complex#angle: implemented, parameters []. Returns the argument (angle) for self in radians; see polar coordinates: An example calling it.
  • Complex#arg: implemented, parameters []. Returns the argument (angle) for self in radians; see polar coordinates: An example calling it.
  • Complex#coerce: implemented, parameters [[:req, :other]]. Returns a 2-element array containing two numeric elements, formed from the two operands self and other, of a common compatible type. An example calling it.
  • Complex#conj: implemented, parameters []. Returns the conjugate of self, Complex.rect(self.imag, self.real):
  • Complex#conjugate: implemented, parameters []. Returns the conjugate of self, Complex.rect(self.imag, self.real): An example calling it.
  • Complex#denominator: implemented, parameters []. Returns the denominator of self, which is the least common multiple of self.real.denominator and self.imag.denominator: An example calling it.
  • Complex#eql?: implemented, parameters [[:req, :other]]. Returns true if self and other are the same type and have equal values. An example calling it.
  • Complex#fdiv: implemented, parameters [[:req, :other]]. Returns Complex.rect(self.real/numeric, self.imag/numeric): An example calling it.
  • Complex#finite?: implemented, parameters []. Returns true if both self.real.finite? and self.imag.finite? are true, false otherwise: An example calling it.
  • Complex#hash: implemented, parameters []. Returns the integer hash value for self. An example calling it.
  • Complex#imag: implemented, parameters []. Returns the imaginary value for self:
  • Complex#imaginary: implemented, parameters []. Returns the imaginary value for self: An example calling it.
  • Complex#infinite?: implemented, parameters []. Returns 1 if either self.real.infinite? or self.imag.infinite? is true, nil otherwise: An example calling it.
  • Complex#inspect: implemented, parameters []. Returns a string representation of self: An example calling it.
  • Complex#integer?: implemented, parameters []. Returns true if self is an Integer. An example calling it.
  • Complex#magnitude: implemented, parameters []. Returns the absolute value (magnitude) for self; see polar coordinates: An example calling it.
  • Complex#marshal_dump: implemented, parameters [].
  • Complex#negative?: not implemented. Returns true if self is less than 0, false otherwise. An example calling it.
  • Complex#numerator: implemented, parameters []. Returns the Complex object created from the numerators of the real and imaginary parts of self, after converting each part to the lowest common denominator of the two: An example calling it.
  • Complex#phase: implemented, parameters []. Returns the argument (angle) for self in radians; see polar coordinates: An example calling it.
  • Complex#polar: implemented, parameters []. Returns the array [self.abs, self.arg]: An example calling it.
  • Complex.polar: implemented, parameters [[:req, :args]]. Returns a new Complex object formed from the arguments, each of which must be an instance of Numeric, or an instance of one of its subclasses: Complex, Float, Integer, Rational. An example calling it.
  • Complex#positive?: not implemented. Returns true if self is greater than 0, false otherwise. An example calling it.
  • Complex#quo: implemented, parameters [[:req, :other]]. Returns the quotient of self and other: An example calling it.
  • Complex#rationalize: implemented, parameters [[:rest]]. Returns a Rational object whose value is exactly or approximately equivalent to that of self.real. An example calling it.
  • Complex#real: implemented, parameters []. Returns the real value for self: An example calling it.
  • Complex#real?: implemented, parameters []. Returns false; for compatibility with Numeric#real?. An example calling it.
  • Complex#rect: implemented, parameters []. Returns a new Complex object formed from the arguments, each of which must be an instance of Numeric, or an instance of one of its subclasses: Complex, Float, Integer, Rational; see Rectangular Coordinates: An example calling it.
  • Complex.rect: implemented, parameters [[:req, :args]]. Returns a new Complex object formed from the arguments, each of which must be an instance of Numeric, or an instance of one of its subclasses: Complex, Float, Integer, Rational; see Rectangular Coordinates: An example calling it.
  • Complex#rectangular: implemented, parameters []. Returns the array [self.real, self.imag]: An example calling it.
  • Complex.rectangular: implemented, parameters [[:req, :args]]. Returns a new Complex object formed from the arguments, each of which must be an instance of Numeric, or an instance of one of its subclasses: Complex, Float, Integer, Rational; see Rectangular Coordinates:
  • Complex#to_c: implemented, parameters []. Returns self. An example calling it.
  • Complex#to_f: implemented, parameters []. Returns the value of self.real as a Float, if possible: An example calling it.
  • Complex#to_i: implemented, parameters []. Returns the value of self.real as an Integer, if possible: An example calling it.
  • Complex#to_r: implemented, parameters []. Returns the value of self.real as a Rational, if possible: An example calling it.
  • Complex#to_s: implemented, parameters []. Returns a string representation of self: An example calling it.

The method summaries are the first sentences of Ruby's own documentation for each method, read from MRI 4.0.6's ri data. Ruby's documentation is distributed under Ruby's license.