Numeric
ruby/spec describes 47 methods in core/numeric, and Metorex implements 47 of them. The parameters are what Method#parameters answers under Metorex.
Numeric#%: implemented, parameters[[:req, :other]]. Returnsselfmodulootheras a real numeric (Integer, Float, or Rational).Numeric#+@: implemented, parameters[]. Returnsself.Numeric#-@: implemented, parameters[]. Returnsself, negated.Numeric#<=>: implemented, parameters[[:req]]. Comparesselfandother.Numeric#abs: implemented, parameters[]. Returns the absolute value ofself. An example calling it.Numeric#abs2: implemented, parameters[]. Returns the square ofself. An example calling it.Numeric#angle: implemented, parameters[]. Returns zero ifselfis positive, Math::PI otherwise. An example calling it.Numeric#arg: implemented, parameters[]. Returns zero ifselfis positive, Math::PI otherwise. An example calling it.Numeric#ceil: implemented, parameters[[:opt, :digits]]. Returns the smallest float or integer that is greater than or equal toself, as specified by the givenndigits, which must be an integer-convertible object. An example calling it.Numeric#clone: implemented, parameters[[:key, :freeze]]. Returnsself. An example calling it.Numeric#coerce: implemented, parameters[[:req, :other]]. Returns a 2-element array containing two numeric elements, formed from the two operandsselfandother, of a common compatible type. An example calling it.Numeric#conj: implemented, parameters[]. Returnsself.Numeric#conjugate: implemented, parameters[]. Returnsself. An example calling it.Numeric#denominator: implemented, parameters[]. Returns the denominator (always positive). An example calling it.Numeric#div: implemented, parameters[[:req, :other]]. Returns the quotientself/otheras an integer (viafloor), using method/as defined in the subclass of Numeric. An example calling it.Numeric#divmod: implemented, parameters[[:req, :other]]. Returns a 2-element array[q, r], whereq = (self/other).floor # Quotient. An example calling it.Numeric#dup: implemented, parameters[]. Returnsself. An example calling it.Numeric#eql?: implemented, parameters[[:req, :other]]. Returnstrueifselfandotherare the same type and have equal values. An example calling it.Numeric#fdiv: implemented, parameters[[:req, :other]]. Returns the quotientself/otheras a float, using method/as defined in the subclass of Numeric. An example calling it.Numeric#finite?: implemented, parameters[]. Returnstrueifselfis a finite number,falseotherwise. An example calling it.Numeric#floor: implemented, parameters[[:opt, :digits]]. Returns the largest float or integer that is less than or equal toself, as specified by the givenndigits, which must be an integer-convertible object. An example calling it.Numeric#i: implemented, parameters[]. ReturnsComplex(0, self): An example calling it.Numeric#imag: implemented, parameters[]. Returns zero.Numeric#imaginary: implemented, parameters[]. Returns zero. An example calling it.Numeric#infinite?: implemented, parameters[]. Returnsnil, -1, or 1 depending on whetherselfis finite,-Infinity, or+Infinity. An example calling it.Numeric#integer?: implemented, parameters[]. Returnstrueifselfis an Integer. An example calling it.Numeric#magnitude: implemented, parameters[]. Returns the absolute value ofself. An example calling it.Numeric#modulo: implemented, parameters[[:req, :other]]. Returnsselfmodulootheras a real numeric (Integer, Float, or Rational). An example calling it.Numeric#negative?: implemented, parameters[]. Returnstrueifselfis less than 0,falseotherwise. An example calling it.Numeric#nonzero?: implemented, parameters[]. Returnsselfifselfis not a zero value,nilotherwise; uses methodzero?for the evaluation. An example calling it.Numeric#numerator: implemented, parameters[]. Returns the numerator. An example calling it.Numeric#phase: implemented, parameters[]. Returns zero ifselfis positive, Math::PI otherwise. An example calling it.Numeric#polar: implemented, parameters[]. Returns array[self.abs, self.arg]. An example calling it.Numeric#positive?: implemented, parameters[]. Returnstrueifselfis greater than 0,falseotherwise. An example calling it.Numeric#quo: implemented, parameters[[:req, :other]]. Returns the most exact division (rational for integers, float for floats). An example calling it.Numeric#real: implemented, parameters[]. Returnsself. An example calling it.Numeric#real?: implemented, parameters[]. Returnstrueifselfis a real number (i.e. An example calling it.Numeric#rect: implemented, parameters[]. Returns array[self, 0]. An example calling it.Numeric#rectangular: implemented, parameters[]. Returns array[self, 0]. An example calling it.Numeric#remainder: implemented, parameters[[:req, :other]]. Returns the remainder after dividingselfbyother. An example calling it.Numeric#round: implemented, parameters[[:opt, :digits]]. Returnsselfrounded to the nearest value with a precision ofdigitsdecimal digits. An example calling it.Numeric#singleton_method_added: implemented, parameters[[:req, :name]]. Invoked as a callback whenever a singleton method is added to the receiver. An example calling it.Numeric#step: implemented, parameters[[:opt, :limit], [:opt, :by], [:keyrest, :options], [:block, :block]]. Generates a sequence of numbers; with a block given, traverses the sequence. An example calling it.Numeric#to_c: implemented, parameters[]. Returnsselfas a Complex object. An example calling it.Numeric#to_int: implemented, parameters[]. Returnsselfas an integer; converts using methodto_iin the subclass of Numeric. An example calling it.Numeric#truncate: implemented, parameters[[:opt, :digits]]. Returnsselftruncated (toward zero) to a precision ofdigitsdecimal digits. An example calling it.Numeric#zero?: implemented, parameters[]. Returnstrueifzerohas a zero value,falseotherwise. 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.